I created new VM instance (jenkins-server) on project1 and I installed jenkins server on it . one of the jenkins jobs should build my app and deploy it on project2 with the following command
mvn gcloud:deploy -Dgcloud.gcloud_project=project2 -Dgcloud.version=jenkins-build-1
The command fails due to the following error :
[INFO] Beginning deployment...
[INFO] DEBUG: No bucket specified, retrieving default bucket.
[INFO] DEBUG: {u'status': u'PERMISSION_DENIED', u'message': u'Request had insufficient authentication scopes.',
u'code': 403}
[INFO] ERROR: Error Response: [403] Request had insufficient authentication scopes.
[INFO] DEBUG: Using bucket [].
[INFO] DEBUG: (gcloud.preview.app.deploy) Could not retrieve the default Google Cloud Storage bucket for [project2]. Please try again or use the [bucket] argument.
I created new bucket on project2 called jenkins-server and tried the command again with the bucket argument
[INFO] Beginning deployment...
[INFO] DEBUG: Using bucket [gs://jenkins-server].
[INFO] DEBUG: Host: appengine.google.com
[INFO] DEBUG: (gcloud.preview.app.deploy) Required scopes ['https://www.googleapis.com/auth/appengine.admin', 'https://www.googleapis.com/auth/cloud-platform'] missing from [list of scopes]. This VM instance probably needs to be recreated with the missing scopes
Project1 is created with full permissions
Google SDK version is up to date : Google Cloud SDK 95.0.0
[EDIT][UPDATE]
on project1 I used an image with pre-installed jenkins on jenkins-server instance but I recreated the instance with ubuntu 14.04 LTS only and installed everything else manually (cloud sdk , tomcat server,jenkins ,maven ...)
The issue above disappeared but now I am getting different error
ERROR: (gcloud.preview.app.deploy) Could not synchronize files. The gsutil command exited with status [1]
and after checking the log file I can see the following error :
Building synchronization state... Caught non-retryable exception while listing file:///tmp/tmpsgDQKG: [Errno 2] No such file or directory: '/tmp/tmpsgDQKG/cc79fffba16616623f47691da45b33db1beb4209.pem'
CommandException: Caught non-retryable exception - aborting rsync
this is the same error for default and custom bucket
Appreciate your help
As per the detail for issue 532 which was filed, the workaround was to deploy using
gcloud config set app/use_gsutil false
, however this is now the default as of gcloud version 106.0.0