I'm deploying a PHP app on the AppEngine Flexible environment. I have a command in my post-deploy-cmd scripts in my composer.json file to set permissions for the public/app folder (chmod -R 755 public\/app). However, when I deploy my app, the entire public folder's permissions get overwritten with 550.
I can see in the logs that the following command runs right after my deployment commands - + chmod -R 550 /app/public
How can I run my command after that or stop that command from running at all? Any workarounds?
Related
I would like to transfer file from my local machine to Google cloud instance. Here is my command:
gcloud compute scp "C:\Temp\esim_replication.ipynb" nlp-3:
Here is error message:
pscp: unable to open ./esim_replication.ipynb: permission denied
ERROR: (gcloud.compute.scp) [C:\Program Files (x86)\Google\Cloud SDK\google-clou
d-sdk\bin\sdk\pscp.exe] exited with return code [1].
This is brand new error. Everything worked fine 2 weeks ago. I am on Windows 7 locally and ran cmd as Administrator. I tried the above command with and without quotations.
Any suggestions?
Go to gcloud via ssh:
gcloud beta compute ssh --zone "your_zone" "instance_name" --project "project_name"
Give full access to your file:
sudo chmod 777 esim_replication.ipynb
In case someone finds this like I did: I had a similar error message, and what did the trick for me was using sudo: sudo gcloud compute scp [LOCAL] [REMOTE]. Apparently there was the need for updating the project ssh metadata (even though copying in the other direction worked just fine).
Encountered the same error while transferring from my local Windows desktop to Debian VM in GCP.
Changed the permission of the destination folder to 777.
gcloud compute scp source_folder/File1.txt VM_instance_name:destination_folder
It worked!
What? from a windows machine?
'sudo' is not recognized as an internal or external command,
operable program or batch file.
It turned out that I already had identically named file at destination. This caused the error. But Patrick W comment is very helpful
I am new to appengine and have installed google-cloud-sdk from the AUR(arch user repository) and and the google-appengine-go extention at /opt/google-cloud-sdk
thanks to this I am able to run a dev server using
dev_appserver.py app.yaml
But when using goapp serve I found
goapp: command not found
After adding /opt/google-cloud-sdk/platform/google_appengine:$PATH to my $PATH variable in zshrc and running goapp serve i now get the error.
zsh: permission denied: goapp
if sudo goapp serve
sudo: goapp: command not found
Due to this I am unable to use the updated sdk to run tests using goapp test
Thank you in advance for your help.
I had the same problem and I think I figured out how it usually works.
You download the google cloud sdk (https://cloud.google.com/sdk/downloads)
After downloading and unzipping to the folder where you want to use it you have to executet the ./google-cloud-sdk/install.sh.
Appengine is not part of the download.
It can be chosen with that install.sh script.
it will download items like appengine.
Afterwards you have a folder called
platform/google_appengine
as you mentioned yourself.
You might have to change execution permissions like
chmod 755 platform/google_appengine/go*
Add folder platform/google_appengine to the PATH if not done already.
The command "which" will not show non-executable binaries.
If you did not change permissions it will not show the path, even being within the PATH variable.
When I try to update my appengine project, it gives me an error.
$ sudo gcloud app deploy
ERROR: (gcloud.app.deploy) Staging command [/usr/local/google-cloud-sdk/platform/google_appengine/goroot-1.6/bin/go-app-stager /Users/baz/app/app.yaml /tmp/tmpSZLK/tmpIQ4] failed with return code [1].
------------------------------------ STDOUT ------------------------------------
------------------------------------ STDERR ------------------------------------
2017/07/08 16:22:06 failed analyzing /Users/baz/app: cannot find package "bitbucket.org/foo/bar" in any of:
($GOROOT not set)
($GOPATH not set)
GOPATH:
$ echo $GOPATH
/Users/baz/go
$ go env GOPATH
/Users/baz/go
Clearly GOPATH is set (I export it in my .bash_profile).
TL;DR - Do not use sudo for deploying the app.
Longer version
You're running the gcloud app deploy command using sudo. sudo by the nature of the command will not retain the current set of environment variables when running the command as root user.
Try deploying your app engine app without sudo:
gcloud app deploy
If you do need to run you command as sudo (which is a smell that your setup is broken somehow), you can look at this post. Although, I would recommend looking into the possibility of running your command without sudo.
I run my websites on a dedicated server. I have full control.
I placed a start.sh file like
#!/bin/bash
cd /opt/solr-4.3.0/example
/usr/bin/java -jar start.jar
in /root
then I gave it world execution permission with
chmod og+x start.sh
then I placed
$HOME/start.sh
into /etc/rc.local
After restarting apache, SOLR home page at http:domain.com:8983/solr is not accessible
I have some web service + some shell scripts which I want to execute with cron.
The problem is with the tmp directory.
To make webservice work I had to run command sudo chown -R www-data:www-data app/tmp (www-data is group and user used by apache)
The problem is that then when I execute CakeShell with some user I get lots of errors telling that some files in app/tmp dir are not writable - this is because tmp dir is owned by www-data...
I can run those scripts with root user - then I don't get any errors...
When I run scripts with root user, from time to time those scripts modify some files in app/tmp and then I got many errors on webservice (website) that some files in app/tmp are not writable. It seems that runing scripts sometimes modifies tmp files with permissions of user executing those scripts.
I want to execute those scripts from cron.
And my questions are:
What is correct setup for app/tmp dir (permissions, user, group etc) and how I can set it up to get both webservice and executing scripts from shell working?
Is it possible to set up permissions to app/tmp dir to allow writing and reading it for all users and groups? Is it good idea?
If you do not use a shared webserver, you can use a permissive ownership:
chmod -R 777 app/tmp
If you own the server/VPS, it's not a security hole, since the more sensible user (www-data) already have access.
OR
You can run the crontab "in name of" www-data user, using the command su