GeezerVison is showing github.com — Mismatch between WriteLogEntriesRequest' · Issue #1889 · googleapis/google-cloud-python
Mismatch between WriteLogEntriesRequest' #1889Labels api: loggingIssues related to the Cloud Logging API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. Activitytseaver commented on Jun 22, 2016 ContributorAuthor More actions @bjwatson, @tbetbetbe PTAL. This is with gax-google-login-v2 0.7.9.
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/logging/_gax.py", line 108, in write_entries
labels, partial_success, options)
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/py27/lib/python2.7/site-packages/google/logging/v2/logging_service_v2_api.py", line 281, in write_log_entries
partial_success=partial_success)
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/py27/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 496, in init
field = _GetFieldByName(message_descriptor, field_name)
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/py27/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 560, in _GetFieldByName
(message_descriptor.name, field_name))
ValueError: Protocol message WriteLogEntriesRequest has no "partial_success" field.bjwatson commented on Jun 22, 2016 @tseaver Do you have a recipe for reproducing this? Can I assume it's something like the recipe in #1869? tseaver commented on Jun 22, 2016 ContributorAuthor More actions @bjwatson I think this would do it.
$ git clone [email protected]:GoogleCloudPlatform/gcloud
$ cd gcloud
$ tox -e system-tests --notest
$ .tox/system-tests/bin/python
and then:
from google.logging.v2.config_service_v2_api import ConfigServiceV2Api
from google.logging.v2.logging_service_v2_api import LoggingServiceV2Api
from google.logging.v2.metrics_service_v2_api import MetricsServiceV2Api
from gcloud.logging._gax import _LoggingAPI
from gcloud.logging import Client
client = Client()
client._logging_api = _LoggingAPI(LoggingServiceV2Api())
logger = client.logger('gcloud-issue-1889')
logger.log_text('This will explode')tseaver commented on Jun 22, 2016 ContributorAuthor More actions Maybe one file is generated from an older version of its .proto? bjwatson commented on Jun 23, 2016 tseaver commented on Jun 23, 2016 ContributorAuthor More actions @bjwatson From grpc-google-logging-v2-1.0.19::
$ grep logging_pb2 .tox/py27/lib/python2.7/site-packages/grpc_google_logging_v2-1.0.19.dist-info/RECORD
google/logging/v2/logging_pb2.py,sha256=qR-LZLvfOTZI_GHyRJmeR9jzpKbDfjjBYvN_M3R1SIw,24755
google/logging/v2/logging_pb2.pyc,, bjwatson commented on Jun 23, 2016 I see. We have a stale logging 1.x release somewhere in the search path. I'll hunt it down and destroy it. :) bjwatson commented on Jun 23, 2016 @tseaver There were stale versions of grpc-google-logging-v2 on PyPi. I had looked for previous releases of gax-google-logging-v2 and didn't find any, but I should have checked for the grpc version, too.
Looks like we're on to the next bug, and this issue can be closed:
brianwatson@brianwatson0:~/src/gapi-dev/gcloud-python$ .tox/system-tests/bin/pythonPython 2.7.11 (default, Apr 12 2016, 12:58:26)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.logging.v2.config_service_v2_api import ConfigServiceV2Api
>>> from google.logging.v2.logging_service_v2_api import LoggingServiceV2Api
>>> from google.logging.v2.metrics_service_v2_api import MetricsServiceV2Api
>>> from gcloud.logging._gax import _LoggingAPI
>>> from gcloud.logging import Client
>>>
>>> client = Client()
>>> client._logging_api = _LoggingAPI(LoggingServiceV2Api())
>>> logger = client.logger('gcloud-issue-1889')
>>> logger.log_text('This will explode')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/google/home/brianwatson/src/gapi-dev/gcloud-python/gcloud/logging/logger.py", line 186, in log_text
client.logging_api.write_entries([entry_resource])
File "/usr/local/google/home/brianwatson/src/gapi-dev/gcloud-python/gcloud/logging/_gax.py", line 107, in write_entries
labels, partial_success, options)
File "/usr/local/google/home/brianwatson/src/gapi-dev/gcloud-python/.tox/system-tests/lib/python2.7/site-packages/google/logging/v2/logging_service_v2_api.py", line 282, in write_log_entries
self._write_log_entries(request, options)
File "/usr/local/google/home/brianwatson/src/gapi-dev/gcloud-python/.tox/system-tests/lib/python2.7/site-packages/google/gax/api_callable.py", line 474, in inner
return api_caller(api_call, this_settings, request)
File "/usr/local/google/home/brianwatson/src/gapi-dev/gcloud-python/.tox/system-tests/lib/python2.7/site-packages/google/gax/api_callable.py", line 462, in base_caller
return api_call(*args)
File "/usr/local/google/home/brianwatson/src/gapi-dev/gcloud-python/.tox/system-tests/lib/python2.7/site-packages/google/gax/api_callable.py", line 427, in inner
sys.exc_info()[2])
google.gax.errors.GaxError: GaxError(RPC failed, caused by NetworkError(code=StatusCode.INVALID_ARGUMENT, details="A log name must be specified for each log entry"))
tseaver commented on Jun 23, 2016 ContributorAuthor More actions I have just pushed a fix for that error on #1892. tseaver commented on Jun 23, 2016 ContributorAuthor More actions After setting up with this gist, Logger.log_text() works when the client is configured with a GAX adapter. bjwatson commented on Jun 23, 2016
MetadataMetadataapi: loggingIssues related to the Cloud Logging API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DevelopmentNo branches or pull requestsIssue actions
|