gana2188 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

gcloud components update gae-python-launcher-mac throws Exception #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

> gcloud components update gae-python-launcher-mac

What is the expected output? What do you see instead?

A stack-trace at the installation stage (staging area step works fine)

What is the output of 'gcloud info'?

Google Cloud SDK [0.9.32]

Platform: [Mac OS X, x86_64]
Python Version: [2.7.5 (default, Mar  9 2014, 22:15:05)  [GCC 4.2.1 Compatible 
Apple LLVM 5.0 (clang-500.0.68)]]
Site Packages: [Disabled]

Installation Root: [/Users/pranav.g10/.mybin/google-cloud-sdk]
Installed Components:
  core: [2014.09.10]
  app-engine-python: [1.9.10]
  core-nix: [2014.09.10]
  compute: [2014.09.10]
  gsutil-nix: [4.6]
  app-engine-python-extras: [1.9.6]
  gsutil: [4.6]
  bq: [2.0.18]
  dns: [2014.09.02]
  sql: [2014.09.02]
  gcutil: [1.16.5]
  gcutil-nix: [1.16.5]
  bq-nix: [2.0.18]
System PATH: 
[/Users/pranav.g10/.mybin/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr
/sbin:/sbin:/Users/pranav.g10/.mybin:/Users/pranav.g10/Library/Python/2.7/bin:]
Cloud SDK on PATH: [True]

Installation Properties: [/Users/pranav.g10/.mybin/google-cloud-sdk/properties]
User Config Directory: [/Users/pranav.g10/.config/gcloud]
User Properties: [/Users/pranav.g10/.config/gcloud/properties]
Current Workspace: [None]
Workspace Config Directory: [None]
Workspace Properties: [None]

Please provide any additional information below.

The exact output of the above command is listed below.

The following components will be installed:
    -----------------------------------------------------------------
    | App Engine Launcher Application for Mac |     1.9.10 | 7.4 MB |
    | App Engine SDK for Python and PHP       | 2014.05.06 | < 1 MB |
    -----------------------------------------------------------------

Do you want to continue (Y/n)?  

Creating update staging area...

Installing: App Engine Launcher Application for Mac ... Traceback (most recent 
call last):
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 150, in <module>
    main()
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 146, in main
    _cli.Execute()
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 431, in Execute
    post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute
    pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 882, in Run
    result = command_instance.Run(args)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/components/update.py", line 65, in Run
    args.component_ids, allow_no_backup=args.allow_no_backup)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/core/updater/update_manager.py", line 465, in Update
    self._InstallFunction(staging_state, diff))
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/core/updater/update_manager.py", line 380, in _UpdateAndPrint
    action_func(component.id)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/core/updater/update_manager.py", line 386, in Inner
    return install_state.Install(diff.latest, component_id)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/core/updater/local_state.py", line 81, in _TryFunc
    return func(*args, **kwargs)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/core/updater/local_state.py", line 405, in Install
    files = self._GetInstaller(snapshot).Install(component_id)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/core/updater/installers.py", line 109, in Install
    return self._InstallTar(component)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/core/updater/installers.py", line 144, in _InstallTar
    url, self.__download_directory, self.__sdk_root)
  File "/Users/pranav.g10/.mybin/google-cloud-sdk/./lib/googlecloudsdk/core/updater/installers.py", line 178, in DownloadAndExtractTar
    tar.extractall(extract_dir)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2047, in extractall
    self.extract(tarinfo, path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2084, in extract
    self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2168, in _extract_member
    self.makelink(tarinfo, targetpath)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2245, in makelink
    os.unlink(targetpath)
OSError: [Errno 1] Operation not permitted: 
'/Users/pranav.g10/.mybin/google-cloud-sdk.staging/platform/GoogleAppEngineLaunc
her.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/goo
gle_appengine'

PS: I checked the permissions of the entire SDK directory (and 
sub-directories), all of the files belong to my local user (so no root 
privileges should be needed). In fact, if I run a generic gcloud components 
update, the remaining components update fine, only the gae-python-launcher-mac 
causes the above issue

Original issue reported on code.google.com by pranav....@gmail.com on 26 Sep 2014 at 9:19

GoogleCodeExporter commented 9 years ago
Don't know if this is relevant.....

In the meantime, I installed the "Google App Engine SDK For Python" via the 
installer listed at https://cloud.google.com/appengine/downloads. It seems that 
the gcloud command line util is trying to install version 1.9.10 of the 
Launcher whereas the Installer is installing version 1.9.12.

Original comment by pranav....@gmail.com on 26 Sep 2014 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by rdayal@google.com on 29 Sep 2014 at 12:10

GoogleCodeExporter commented 9 years ago
The version mismatch is unrelated.  The Cloud SDK releases on a different 
schedule than the App Engine SDK, so there are sometimes delays in it picking 
up the latest version.

RE the original problem, do you see this with a fresh install of the SDK.  Does 
the file the error mentions exist both in the original installation here: 

/Users/pranav.g10/.mybin/google-cloud-sdk/platform/GoogleAppEngineLauncher.app/C
ontents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appen
gine

As well as in the staging area after failure, here:

/Users/pranav.g10/.mybin/google-cloud-sdk.staging/platform/GoogleAppEngineLaunch
er.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/goog
le_appengine

If it exists, is it a symlink?

Original comment by markp...@google.com on 29 Sep 2014 at 9:26

GoogleCodeExporter commented 9 years ago
It exists in both locations and is a normal folder at both places. The long 
listing of the parent directory in the staging folder is as follows:
total 101280
drwx------   4 pranav.g10  staff   136B Sep  3 01:02 ./
drwx------   3 pranav.g10  staff   102B Aug 26 04:47 ../
drwxr-xr-x  31 pranav.g10  staff   1.0K Sep 26 10:16 google_appengine/
-rw-r--r--   1 pranav.g10  staff    49M Sep 19 23:38 google_appengine.zip

I will try a fresh install on a separate machine to update about the problem 
occurring on fresh install

Original comment by pranav....@gmail.com on 30 Sep 2014 at 5:12

GoogleCodeExporter commented 9 years ago
Isn't the issue the script is attempting to use "unlink" on a directory?   I am 
currently  experiencing this issue.

Original comment by roarke.g...@whyhigh.com on 15 Oct 2014 at 7:46

GoogleCodeExporter commented 9 years ago
Is your failure happening on installing or uninstalling the component?  If it 
is the exact same issue as above, this is strange because the directory it is 
failing on should not be present in any form (link or directory) at the time 
the component installation is happening.  This indicates that your installation 
is already in a corrupted state.

Can you tell me the exact command you are running (along with the failure) as 
well as the output of `gcloud components list`?

Also, have you installed the standalone App Engine SDK using the native mac 
installer from here: https://cloud.google.com/appengine/downloads ?  Any chance 
that is conflicting with your Cloud SDK installation?

Original comment by markp...@google.com on 15 Oct 2014 at 8:05

GoogleCodeExporter commented 9 years ago
I originally saw this when updating my components:

gcloud components update

I then removed that component and that worked fine:

gcloud components remove gae-python-launcher-mac

I then tried to install it again which fails the same way:

gcloud components update gae-python-launcher-mac

I don not have the download app installed.  The only reason I install the app 
is to put the appengine scripts on my path (e.g. appcfg.py dev_server.py, 
etc...)

The failure is coming from an attempt to unlink a directory in the staging 
directory not the existing directory.  So I am not sure what it is suppose to 
be a link to?  It is definitely not a link.

(whyhigh)Roarkes-MacBook-Pro:whyhigh roarkegaskill$ ls -l 
~/google-cloud-sdk.staging/platform/GoogleAppEngineLauncher.app/Contents/Resourc
es/GoogleAppEngine-default.bundle/Contents/Resources/
total 101280
drwxr-xr-x  30 roarkegaskill  staff      1020 Oct 13 14:39 google_appengine
-rw-r--r--   1 roarkegaskill  staff  51854198 Oct  6 16:10 google_appengine.zip

The exception listed below is what I get in both failure cases listed above:

Roarkes-MacBook-Pro:~ roarkegaskill$ gcloud components update 
gae-python-launcher-mac

The following components will be installed:
    -----------------------------------------------------------------
    | App Engine Launcher Application for Mac |     1.9.13 | 8.3 MB |
    | App Engine SDK for Python and PHP       | 2014.05.06 | < 1 MB |
    -----------------------------------------------------------------

Do you want to continue (Y/n)?  

Creating update staging area...

Installing: App Engine Launcher Application for Mac ... Traceback (most recent 
call last):
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 153, in <module>
    main()
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 149, in main
    _cli.Execute()
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 431, in Execute
    post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute
    pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 882, in Run
    result = command_instance.Run(args)
  File "/Users/roarkegaskill/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/components/update.py", line 65, in Run
    args.component_ids, allow_no_backup=args.allow_no_backup)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/core/updater/update_manager.py", line 465, in Update
    self._InstallFunction(staging_state, diff))
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/core/updater/update_manager.py", line 380, in _UpdateAndPrint
    action_func(component.id)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/core/updater/update_manager.py", line 386, in Inner
    return install_state.Install(diff.latest, component_id)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/core/updater/local_state.py", line 81, in _TryFunc
    return func(*args, **kwargs)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/core/updater/local_state.py", line 405, in Install
    files = self._GetInstaller(snapshot).Install(component_id)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/core/updater/installers.py", line 109, in Install
    return self._InstallTar(component)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/core/updater/installers.py", line 144, in _InstallTar
    url, self.__download_directory, self.__sdk_root)
  File "/Users/roarkegaskill/google-cloud-sdk/./lib/googlecloudsdk/core/updater/installers.py", line 178, in DownloadAndExtractTar
    tar.extractall(extract_dir)
  File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2051, in extractall
    self.extract(tarinfo, path)
  File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2088, in extract
    self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
  File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2172, in _extract_member
    self.makelink(tarinfo, targetpath)
  File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2249, in makelink
    os.unlink(targetpath)
OSError: [Errno 1] Operation not permitted: 
'/Users/roarkegaskill/google-cloud-sdk.staging/platform/GoogleAppEngineLauncher.
app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_
appengine'

Original comment by roarke.g...@whyhigh.com on 15 Oct 2014 at 8:34

GoogleCodeExporter commented 9 years ago
Are you saying that you *do* have the native App Engine launcher app installed, 
in order to get the scripts on your PATH?  That native app and the Cloud SDK do 
not inter-operate, and that maybe we why you have the directory that should not 
exist.

Original comment by markp...@google.com on 15 Oct 2014 at 9:11

GoogleCodeExporter commented 9 years ago
Sorry for the type.  No I do NOT have the native app engine launcher app 
installed.  I am using the gcloud version to get the scripts on the path.

Original comment by roarke.g...@whyhigh.com on 15 Oct 2014 at 9:13

GoogleCodeExporter commented 9 years ago
Also I have manually deleted the stage directory and the error still occurs.

/Users/roarkegaskill/google-cloud-sdk.staging

The gcloud script is creating that directory, so it is putting a directory 
where a link should be.

Original comment by roarke.g...@whyhigh.com on 15 Oct 2014 at 9:18

GoogleCodeExporter commented 9 years ago
The issue is not actually with the staging directory.  Staging is just a copy 
of the installation directory, which in this case has the google_appengine 
directory and the google_appengine.zip file despite that component not being 
installed.  It does not make sense for either of those to exist there.  We 
actually do not distribute any file called google_appengine.zip (that comes in 
the native installer which is why I was asking about that).

If you remove the entire SDK, and do a fresh install, do you see this problem?  
On a fresh installation, are you able to run:

gcloud components update gae-python-launcher-mac
gcloud components remove gae-python-launcher-mac
gcloud components update gae-python-launcher-mac

does that succeed?

Original comment by markp...@google.com on 15 Oct 2014 at 9:43

GoogleCodeExporter commented 9 years ago
Ah ok.  

So I first ran remove and it failed saying it wasn't installed.

gcloud components remove gae-python-launcher-mac

I then manually deleted the app directory (not stage).

rm -rf 
/Users/roarkegaskill/google-cloud-sdk/platform/GoogleAppEngineLauncher.app

Then I ran the scripts as you suggested and all worked fine.

gcloud components update gae-python-launcher-mac
gcloud components remove gae-python-launcher-mac
gcloud components update gae-python-launcher-mac

I don't know how that directory got into the state it was in.  I have never had 
the native version installed on this machine.  I wonder if it is the google 
auto updater that messed it up.  I do have a recollection that I was asked to 
update the app a while ago, but I don't know for sure if it was on this 
machine.  That may have been on a different computer where I know I have the 
native app installed.

Anyways, all is working now.  Thanks for your help!

Original comment by roarke.g...@whyhigh.com on 15 Oct 2014 at 9:59

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It appears to be the google updater is causing this.  The google updater asked 
me to update the app engine app this morning.

Before the updater update:

ls -l 
~/google-cloud-sdk/platform/GoogleAppEngineLauncher.app/Contents/Resources/Googl
eAppEngine-default.bundle/Contents/Resources

-rw-r--r--  1 roarkegaskill  staff   142525 Oct  6 16:10 LICENSE
lrwxr-xr-x  1 roarkegaskill  staff       34 Oct 15 16:50 google_appengine -> 
../../../../../../google_appengine
-rwxr-xr-x  1 roarkegaskill  staff   610908 Oct  6 16:10 libfreetype.6.dylib
-rwxr-xr-x  1 roarkegaskill  staff   204756 Oct  6 16:10 libpng16.16.dylib
-rwxr-xr-x  1 roarkegaskill  staff     6504 Oct 14 15:09 packagemanager.py
-rwxr-xr-x  1 roarkegaskill  staff  7449064 Oct  6 16:10 php
-rwxr-xr-x  1 roarkegaskill  staff  7186272 Oct  6 16:10 php-cgi

After the updater update:

ls -l 
~/google-cloud-sdk/platform/GoogleAppEngineLauncher.app/Contents/Resources/Googl
eAppEngine-default.bundle/Contents/Resources

-rw-r--r--  1 roarkegaskill  staff    142525 Oct 16 15:54 LICENSE
-rw-r--r--  1 roarkegaskill  staff  52041200 Oct 16 15:54 google_appengine.zip
-rwxr-xr-x  1 roarkegaskill  staff    610908 Oct 16 15:54 libfreetype.6.dylib
-rwxr-xr-x  1 roarkegaskill  staff    204756 Oct 16 15:54 libpng16.16.dylib
-rwxr-xr-x  1 roarkegaskill  staff      6548 Oct 16 15:54 packagemanager.py
-rwxr-xr-x  1 roarkegaskill  staff   7449064 Oct 16 15:54 php
-rwxr-xr-x  1 roarkegaskill  staff   7186272 Oct 16 15:54 php-cgi

I am not sure where the google updater was installed from.  I didn't explicitly 
install it and it is not in my applications directory.  Does it get installed 
with the  gcloud gae-python-launcher-mac component?

Original comment by roarke.g...@whyhigh.com on 22 Oct 2014 at 11:30

GoogleCodeExporter commented 9 years ago
Thanks very much for your help debugging this.  The issue turns out to be that 
yes, the google updater is being installed with the gae-python-launcher-mac 
component (which is a bug).  The google updater is not compatible with the 
Cloud SDK.  The workaround right now is to just cancel the updater if it ever 
pops up.  I will work on a fix to disable this (all updates should come through 
running $gcloud components update).  Thanks!

Original comment by markp...@google.com on 22 Oct 2014 at 10:27

GoogleCodeExporter commented 9 years ago
I have the same error message today with the latest update. I do not have the 
google auto updater running nor the stand-alone appengine launcher installed

Original comment by jojohns...@kaplan.edu on 25 Feb 2015 at 10:17

GoogleCodeExporter commented 9 years ago
http://1.bp.blogspot.com/--fUiMwvHiv4/VRCoATkzXjI/AAAAAAAAAOY/5zLFBrcjQA0/s1600/
10952930_824597670944908_7245883814427587386_n.jpg

Original comment by j.b.whip...@gmail.com on 24 Mar 2015 at 4:11