Quentin123345 / google-cloud-sdk

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

gcloud info not working! #460

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
gcloud info

What is the expected output? What do you see instead?
I am expecting to see gcloud infoormation. Instead, I am seeing:
Traceback (most recent call last):
  File "/usr/bin/../lib/google-cloud-sdk/./lib/gcloud.py", line 21, in <module>
    main()
  File "/usr/bin/../lib/google-cloud-sdk/./lib/gcloud.py", line 17, in main
    sys.exit(googlecloudsdk.gcloud_main.main())
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/gcloud_main.py", line 119, in main
    gcloud_cli = CreateCLI([])
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/gcloud_main.py", line 108, in CreateCLI
    generated_cli = loader.Generate()
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 326, in Generate
    cli = self.__MakeCLI(top_group)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 506, in __MakeCLI
    log.AddFileLogging(self.__logs_dir)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 611, in AddFileLogging
    _log_manager.AddLogsDir(logs_dir=logs_dir)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 345, in AddLogsDir
    file_handler = logging.FileHandler(log_file)
  File "/usr/lib/python2.7/logging/__init__.py", line 903, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 928, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: 
'/home/meqbeln/.config/gcloud/logs/2016.01.06/23.07.35.682172.log'

What is the output of 'gcloud info'?
as above

Please provide any additional information below.
when I run gcloud info as sudo, it works and I see:
Google Cloud SDK [91.0.1]
Platform: [Linux, x86_64]
Python Version: [2.7.6 (default, Jun 22 2015, 17:58:13)  [GCC 4.8.2]]
Python Location: [/usr/bin/python2]
Site Packages: [Disabled]
Installation Root: [/usr/lib/google-cloud-sdk]
Installed Components:
  core: [2015.12.16]
  core-nix: [2015.12.16]
  gcloud: []
  gsutil-nix: [4.16]
  gsutil: [4.16]
  bq: [2.0.18]
  bq-nix: [2.0.18]
System PATH: [/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]
Cloud SDK on PATH: [False]
Installation Properties: [/usr/lib/google-cloud-sdk/properties]
User Config Directory: [/home/meqbeln/.config/gcloud]
User Properties: [/home/meqbeln/.config/gcloud/properties]
Current Workspace: [None]
Workspace Config Directory: [None]
Workspace Properties: [None]
Account: [XXXXXXXXXX-compute@developer.gserviceaccount.com]
Project: [modem-1125]
Current Properties:
  [core]
    project: [modem-1125]
    account: [XXXXXXXXXX-compute@developer.gserviceaccount.com]
  [compute]
    region: [europe-west1]
    zone: [europe-west1-c]
Logs Directory: [/home/meqbeln/.config/gcloud/logs]
Last Log File: 
[/home/meqbeln/.config/gcloud/logs/2016.01.06/18.51.37.412168.log]

The question is: why it works when I run it as sudo and doesn't work when I run 
it as normal user?

Many thanks in advanced,
Meqbel 

Original issue reported on code.google.com by meqb...@gmail.com on 6 Jan 2016 at 11:22

GoogleCodeExporter commented 8 years ago
You've created a log directory (/home/meqbeln/.config/gcloud/logs) that your 
meqbeln user isn't capable of writing to. Try running

    $ sudo chown -R meqbeln /home/meqbeln/.config/gcloud
    $ chmod -R +w /home/meqbeln/.config/gcloud

to fix the permissions.

Original comment by z...@google.com on 7 Jan 2016 at 4:40