Getting started with a Perforce project...

Hey,

So, I'm just trying out Upsource as a potential replacement for our GitHub-based reviews and repo browsing now that we're migrating a lot of projects to Perforce. Naturally I've got it all up and running without any fuss in a Docker container on our beefy inhouse server based on Ubuntu 12.04 LTS. Now I'm trying to add a first project -- using Perforce -- and Test Connection repeatedly errors:

Test VCS connection failed.
Fatal client error; disconnecting!
open for write: /root/tmp.7572.62: Permission denied


I gather this is trying to create some temp file in root's home dir and failing. Upsource is running as a non-root user (upsource) and I can run the exact same commands that (it appears) upsource is running as both the upsource user (and root.)

It looks like Upsource is running p4 -V, then a p4 -u username -p p4port login. The account I've created for Upsource on the P4 server is a super user. Is there some documentation that I'm missing that can help?



Relevant log (from upsource-stdout.log) chunk:


[2014-12-10 04:05:59,821]  DEBUG - SimpleCommandLineProcessRunner - Start process name: p4 -V
[2014-12-10 04:05:59,824]  DEBUG - uildServer.CommandLineExecutor - Start waiting for process finishing
[2014-12-10 04:05:59,827]  DEBUG - uildServer.CommandLineExecutor - Process.waitFor() finished
[2014-12-10 04:05:59,827]  DEBUG - uildServer.CommandLineExecutor - Start waiting for stdout collector thread
[2014-12-10 04:05:59,845]  DEBUG - uildServer.CommandLineExecutor - Finished waiting for stdout collector thread
[2014-12-10 04:05:59,845]  DEBUG - uildServer.CommandLineExecutor - Start waiting for stderr collector thread
[2014-12-10 04:05:59,845]  DEBUG - uildServer.CommandLineExecutor - Finished waiting for stderr collector thread
[2014-12-10 04:05:59,846]  DEBUG - uildServer.CommandLineExecutor - Stop waiting for process finishing
[2014-12-10 04:05:59,846]  DEBUG -   jetbrains.buildServer.VCS.P4 - run p4 -u upsource -p redacted.com:1666 login
[2014-12-10 04:05:59,847]  DEBUG - SimpleCommandLineProcessRunner - Start process name: p4 -u upsource -p redacted.com:1666 login
[2014-12-10 04:05:59,850]  DEBUG - uildServer.CommandLineExecutor - Start waiting for process finishing
[2014-12-10 04:05:59,892]  DEBUG - uildServer.CommandLineExecutor - Process.waitFor() finished
[2014-12-10 04:05:59,893]  DEBUG - uildServer.CommandLineExecutor - Start waiting for stdout collector thread
[2014-12-10 04:05:59,911]  DEBUG - uildServer.CommandLineExecutor - Finished waiting for stdout collector thread
[2014-12-10 04:05:59,911]  DEBUG - uildServer.CommandLineExecutor - Start waiting for stderr collector thread
[2014-12-10 04:05:59,911]  DEBUG - uildServer.CommandLineExecutor - Finished waiting for stderr collector thread
[2014-12-10 04:05:59,912]  DEBUG - uildServer.CommandLineExecutor - Stop waiting for process finishing
[2014-12-10 04:05:59,915]  DEBUG -   jetbrains.buildServer.VCS.P4 - error Fatal client error; disconnecting!
open for write: /root/tmp.7572.62: Permission denied

[2014-12-10 04:05:59,915]   WARN - tion.TestConnectionServiceImpl - TestConnection failed for ____test_connection_workspace_id____1418184359820:a: Fatal client error; disconnecting!
open for write: /root/tmp.7572.62: Permission denied

jetbrains.buildServer.vcs.VcsException: Fatal client error; disconnecting!
open for write: /root/tmp.7572.62: Permission denied

        at jetbrains.buildServer.vcs.perforce.PerforceConnection.runCommand(PerforceConnection.java:316)
        at jetbrains.buildServer.vcs.perforce.PerforceConnection.tryToLogin(PerforceConnection.java:350)
        at jetbrains.buildServer.vcs.perforce.PerforceConnection.testConnection(PerforceConnection.java:555)
        at jetbrains.buildServer.vcs.perforce.PerforceSupport$PerforceTestConnection.testConnection(PerforceSupport.java:267)
        at jetbrains.vcs.api.services.impl.TestConnectionServiceProvider$1.testConnection(TestConnectionServiceProvider.java:32)
        at jetbrains.vcs.server.core.impl.testConnection.TestConnectionServiceImpl.testConnection(TestConnectionServiceImpl.java:39)
        at jetbrains.vcs.server.core.impl.testConnection.TestConnectionUtil.testConnection(TestConnectionUtil.java:27)
        at jetbrains.vcs.server.settings.vcs.service.TestConnectionSettingsServiceImpl.testConnection(TestConnectionSettingsServiceImpl.java:43)
        at jetbrains.vcs.server.settings.web.json.WorkspaceTestController.doConnectionTest(WorkspaceTestController.java:76)
        at jetbrains.vcs.server.settings.web.json.WorkspaceTestController.unknownWorkspace(WorkspaceTestController.java:45)
        at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:497)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
        at java.lang.Thread.run(Thread.java:745)

2 comments

Hi Andy,

Thank you for contacting Upsource Team.

Please note that Upsource itself should be launched under user credentials that has sufficient permissions to access your Perforce project.

Please let me know if it helps.

---

Best Regards,

Artem Rokhin

JetBrains

https://www.jetbrains.com/

"Develop with Pleasure!"

0

Thanks for your reply Artem.

I figured out the problem -- in my case I was using supervisor to start/stop Upsource as the 'upsource' Unix user. In this case my environment was not set correctly ($HOME was /root/) and p4 login attempts to create a p4 tickets file in your home directory (by default.) In order to fix it I am now setting $HOME to the proper value (/home/upsource/ in my case) in my supervisor configuration.

0

Please sign in to leave a comment.