sudo user use cf push fail
I use ubuntu . install cf-linux-amd64.tgz
copy cf to /user/local/bin and adduser cat.
when i push a app as user cat . It report a Fail.
root@x6000-2-2:~# gcf -v gcf version 6.0.2-0bba99f. cat@x6000-2-2:~$ cat /etc/issue Ubuntu 12.04.4 LTS \n \l cat@x6000-2-2:~$ uname -a Linux x6000-2-2 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Using manifest file /home/paas/cf_nise_installer/hello-world/manifest.yml Creating app hello in org DevBox / space sit as admin... OK Creating route hello.2.49.15.36.xip.io... OK Binding hello.2.49.15.36.xip.io to hello... OK Uploading hello... FAILED Error uploading application. mkdir /tmp/cf/apps_1397740346_1073378888: permission denied
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: http://www.pivotaltracker.com/story/show/69699298. This repo is managed by the 'CLI' team.
@nkuacac I'll ask the engineers if they have any idea why this is happening.
Hi @nkuacac,
From the shell output that you have pasted above, it looks like your cat user does not have write permissions to the /tmp folder. This is causing gcf push to fail.
You mentioned in the story title that you were using sudo, but we see that only in the first command in the output above (though strictly speaking, that command is just being run as the root user). All subsequent commands are run as cat.
Some suggestions are to actually run sudo cf push ... or to give the cat user sufficient permissions to write to /tmp.
CF Community Pair (@chou & @jfoley)
Hi, @chou , Thanks for your reply. Please forgive me. I made a mistake. I used paas user.
As user cat cf push is ok. But user paas is not ok. The question is only one user can use cli.
user cat cat@x6000-2-2:~/cf-acceptance-tests/assets/hello-world$ gcf push hellocat Creating app hellocat in org DevBox / space sit as admin... OK
Creating route hellocat.2.49.15.36.xip.io... OK
Binding hellocat.2.49.15.36.xip.io to hellocat... OK
Uploading hellocat... Uploading from: /home/cat/cf-acceptance-tests/assets/hello-world 670, 3 files OK
Warning: error tailing logs websocket.Dial wss://loggregator.2.49.15.36.xip.io:4443/tail/?app=4b0a27cc-a6b2-4eaf-b1a1-31262ef829ef: bad status Starting app hellocat in org DevBox / space sit as admin... OK
1 of 1 instances running
App started
Showing health and status for app hellocat in org DevBox / space sit as admin... OK
requested state: started instances: 1/1 usage: 1G x 1 instances urls: hellocat.2.49.15.36.xip.io
state since cpu memory disk#0 running 2014-04-21 12:29:57 AM 0.0% 65.6M of 1G 50.4M of 1G
cat@x6000-2-2:~/cf-acceptance-tests/assets/hello-world$ user paas paas@x6000-2-2:~/cf_nise_installer/hello-world$ gcf push hellopaas Creating app hellopaas in org DevBox / space sit as admin... OKCreating route hellopaas.2.49.15.36.xip.io... OK
Binding hellopaas.2.49.15.36.xip.io to hellopaas... OK
Uploading hellopaas... FAILED Error uploading application. mkdir /tmp/cf/apps_1398054820_1621552711: permission denied paas@x6000-2-2:~/cf_nise_installer/hello-world$ *user root root@x6000-2-2:/tmp# ll |grep cf drwxrwxr-x 2 cat cat 4096 Apr 21 00:25 cf/ drwx------ 3 cat cat 4096 Apr 16 21:51 cf_home_1025125066/ drwx------ 3 cat cat 4096 Apr 16 22:48 cf_home_1027172237/ root@x6000-2-2:/tmp# ll /usr/local/bin/gcf -rwxr-xr-x 1 501 root 14853558 Mar 4 19:16 /usr/local/bin/gcf root@x6000-2-2:/tmp# gcf -v gcf version 6.0.2-0bba99f root@x6000-2-2:/tmp#
@nkuacac Does your paas user have write privileges to the /tmp folder? If not, you have to grant it to the paas user, otherwise the CloufFoundry CLI tool can not work correctly.
CF Community Pair (@jfoley & @jtuchscherer)
Hi, @jfoley , The paas user have write privileges to the /tmp folder. I think the /tmp/cf is created by cf of user cat. So the paas user don't have right to use it. If I delete /tmp/cf, the paas user can 'cf push'. The cat user can not.
It sounds like the bug is that when this /tmp/cf directory is created, only current the user has write access, when really it should be readable and writable by any user.
However, we no longer create this intermediate /tmp/cf directory as of 6.1.0, so the issue should no longer occur. Can you confirm if this bug is not present in v6.1.0, @nkuacac?
v6.1.0 is ok. Thanks. @tjarratt