runt18 / google-bigquery

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

BQ CLI query throws exception when apilog directory is missing #391

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

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

What version of the product are you using? On what operating system?

Please provide any additional information below.

========================================
== Platform ==
  CPython:2.6.6:Linux-2.6.32-279.22.1.el6.x86_64-x86_64-with-centos-6.3-Final
== bq version ==
  2.0.22
== Command line ==
  ['/home/sasp/SAS_all_divisions/apis/ga_bq/google-cloud-sdk/platform/bq/bq.py', '--credential_file', '/home/sasp/.config/gcloud/legacy_credentials/sasp@answers.com/singlestore.json', '--project', 'g920474334530', 'query', '--apilog', './logs/bq_20151211-15-05-01', '--format=csv', '--project_id', '920474334530', 'SELECT max(updated) as last_updated FROM [920474334530:social_media_stats.posts]']
== UTC timestamp ==
  2015-12-11 15:05:02
== Error trace ==
  File "/home/sasp/SAS_all_divisions/apis/ga_bq/google-cloud-sdk/platform/bq/bq.py", line 711, in RunSafely
    return_value = self.RunWithArgs(*args, **kwds)
  File "/home/sasp/SAS_all_divisions/apis/ga_bq/google-cloud-sdk/platform/bq/bq.py", line 1036, in RunWithArgs
    client = Client.Get()
  File "/home/sasp/SAS_all_divisions/apis/ga_bq/google-cloud-sdk/platform/bq/bq.py", line 517, in Get
    cls.client = Client.Create()
  File "/home/sasp/SAS_all_divisions/apis/ga_bq/google-cloud-sdk/platform/bq/bq.py", line 496, in Create
    bigquery_client.ConfigurePythonLogger(FLAGS.apilog)
  File "/home/sasp/SAS_all_divisions/apis/ga_bq/google-cloud-sdk/platform/bq/bigquery_client.py", line 96, in ConfigurePythonLogger
    logging.basicConfig(filename=apilog, level=logging.INFO)
  File "/usr/lib64/python2.6/logging/__init__.py", line 1402, in basicConfig
    hdlr = FileHandler(filename, mode)
  File "/usr/lib64/python2.6/logging/__init__.py", line 827, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.6/logging/__init__.py", line 846, in _open
    stream = open(self.baseFilename, self.mode)
========================================

Unexpected exception in query operation: [Errno 2] No such file or directory:
'/home/sasp/logs/bq_20151211-15-05-01'

Original issue reported on code.google.com by osris.qu...@answers.com on 11 Dec 2015 at 4:34

GoogleCodeExporter commented 8 years ago
Does the /home/sasp/logs directory exist? I can repro this problem when the 
directory is missing.

Original comment by jcon...@google.com on 11 Dec 2015 at 4:40

GoogleCodeExporter commented 8 years ago
no, the directory does not exist

-- 
*Osris*
Lead Statistician
osris.qusba@answers.com

*p* +1 (650) 625-3200 ext=312
*m* +1 (989) 528-0441

[image: Answers]
www.answers.com

Original comment by osris.qu...@answers.com on 11 Dec 2015 at 5:25

GoogleCodeExporter commented 8 years ago
thanks adding full directory path helped thanks.

Original comment by osris.qu...@answers.com on 11 Dec 2015 at 5:37