Skip to content

path "mysink" did not match expected pattern #1817

@waprin

Description

@waprin

Looks like the Sink resource name is not the fully qualified version. Docs agree: https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/projects.sinks#resource-logsink. I don't see a good reason why it wouldn't be the full name. Once again, I will bug people but for now I think we should disable the validation.

 {u'filter': u'logName=projects/bill-stackdriver-experiment/logs/syslog AND severity>=ERROR', u'destination': u'storage.googleapis.com/bill-new-stackdriver', u'name': u'mysink', u'outputVersionFormat': u'V2'} 
Validating sink name mysink bill-stackdriver-experiment 
Traceback (most recent call last):
  File "export.py", line 102, in <module>
    main(args.project_id, args.destination_bucket)
  File "export.py", line 84, in main
    list_sinks(client)
  File "export.py", line 54, in list_sinks
    sinks = client.list_sinks()[0]
  File "/Users/waprin/.virtualenvs/docsamples10/lib/python2.7/site-packages/gcloud/logging/client.py", line 196, in list_sinks
    for resource in resp.get('sinks', ())]
  File "/Users/waprin/.virtualenvs/docsamples10/lib/python2.7/site-packages/gcloud/logging/sink.py", line 112, in from_api_repr
    sink_name = _sink_name_from_path(resource['name'], client.project)
  File "/Users/waprin/.virtualenvs/docsamples10/lib/python2.7/site-packages/gcloud/logging/sink.py", line 45, in _sink_name_from_path
    return _name_from_project_path(path, project, _SINK_TEMPLATE)
  File "/Users/waprin/.virtualenvs/docsamples10/lib/python2.7/site-packages/gcloud/_helpers.py", line 458, in _name_from_project_path
    path, template.pattern,))
ValueError: path "mysink" did not match expected pattern "
    projects/            # static prefix
    (?P<project>[^/]+)   # initial letter, wordchars + hyphen
    /sinks/              # static midfix
    (?P<name>[^/]+)      # initial letter, wordchars + allowed punc

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the Cloud Logging API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions