balena-io-examples / google-iot

Google Cloud IoT integration
Apache License 2.0
15 stars 8 forks source link

Issue creating test subscription with gcp setup script #8

Open tmigone opened 4 years ago

tmigone commented 4 years ago

Hit some issues with the script:

*** GCP PubSub: Create test subscription to telemetry topic ***
ERROR: Failed to create subscription [projects/balenaio/subscriptions/balena-telemetry-test-sub]: Invalid resource name given (name=projects/balenaio/topics/​€‹).

I then followed the manual guide and everything looks good from the device logs. However, I think the manual steps miss creating the subscription as just creates a topic?

garethtdavies commented 4 years ago

As an update, I added the manual steps for creating the subscription here https://github.com/balenalabs/google-iot/blob/master/GCPManualSetup.md#optional-create-subscription-for-testing. I added it as an optional step.

alexszilagyi commented 3 years ago

Issue running command [gcloud pubsub subscriptions create].

ERROR: gcloud crashed (UnicodeEncodeError): 'utf-8' codec can't encode characters in position 1-2: surrogates not allowed What steps will reproduce the problem? I have tried to run this script: https://github.com/balena-io-examples/google-iot/blob/master/scripts/gcp-setup.sh

What is the expected output? What do you see instead? It should create all the pub/sub topics, it creates only the first ones.

Please provide any additional information below. Tried on MacOS Big Sur 11.4 (20F71), iTerm2 (3.4.8) and Terminal.

Trace:

command_lib/crash_handling.py:190
 target_function(*args, **kwargs)
gcloud_main.py:176
 gcloud_cli.Execute()
calliope/cli.py:1010
 self._HandleAllErrors(exc, command_path_string, specified_arg_names)
calliope/cli.py:1047
 exceptions.HandleError(exc, command_path_string, self.__known_error_handler)
calliope/exceptions.py:551
 core_exceptions.reraise(exc)
core/exceptions.py:146
 six.reraise(type(exc_value), exc_value, tb)
six/__init__.py:693
 raise value
calliope/cli.py:984
 resources = calliope_command.Run(cli=self, args=args)
calliope/backend.py:811
 display_info=self.ai.display_info).Display()
calliope/display.py:483
 self._printer.Print(self._resources)
core/resource/resource_printer_base.py:297
 for resource in resources:
surface/pubsub/subscriptions/create.py:41
 topic_ref = args.CONCEPTS.topic.Parse()
calliope/concepts/handlers.py:87
 return self.parse(self.arg_getter())
command_lib/util/concepts/info_holders.py:389
 allow_empty=self.allow_empty)
calliope/concepts/concepts.py:490
 fallthroughs_map, parsed_args=parsed_args)
calliope/concepts/concepts.py:457
 params=params)
core/resources.py:1193
 default_resolver=default_resolver)
core/resources.py:958
 default_resolver=default_resolver)
core/resources.py:319
 param_values, base_url)
core/resources.py:379
 self._endpoint_url, uritemplate.expand(self._path, self.AsDict()))
uritemplate/api.py:33
 return URITemplate(uri).expand(var_dict, **kwargs)
uritemplate/template.py:132
 return self._expand(_merge(var_dict, kwargs), False)
uritemplate/template.py:97
 expanded.update(v.expand(expansion))
uritemplate/variable.py:338
 expanded = expansion(name, value, opts['explode'], opts['prefix'])
uritemplate/variable.py:289
 return quote(value, self.safe)
uritemplate/variable.py:393
 return urllib.quote(_encode(value), safe)
uritemplate/variable.py:386
 return value.encode(encoding)
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 1-2: surrogates not allowed

Installation information:

Google Cloud SDK [352.0.0]

Platform: [Mac OS X, x86_64] uname_result(system='Darwin', node='MAC-AlexSZILAGYI.local', release='20.5.0', version='Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64', machine='x86_64', processor='i386') Locale: (None, 'UTF-8') Python Version: [3.7.9 (v3.7.9:13c94747c7, Aug 15 2020, 01:31:08) [Clang 6.0 (clang-600.0.57)]] Python Location: [${CLOUDSDK_CONFIG}/virtenv/bin/python3] Site Packages: [Enabled]

Installation Root: [${HOME}/Downloads/google-cloud-sdk] Installed Components: gsutil: [4.66] core: [2021.08.06] bq: [2.0.70] alpha: [2021.08.06] System PATH: [${CLOUDSDK_CONFIG}/virtenv/bin:${HOME}/Downloads/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:${HOME}/.cargo/bin:${HOME}/Development/Flutter/bin] Python PATH: [${HOME}/Downloads/google-cloud-sdk/lib/third_party:${HOME}/Downloads/google-cloud-sdk/lib:/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip:/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7:/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload:${CLOUDSDK_CONFIG}/virtenv/lib/python3.7/site-packages] Cloud SDK on PATH: [False] Kubectl on PATH: [/usr/local/bin/kubectl]

Installation Properties: [${HOME}/Downloads/google-cloud-sdk/properties] User Config Directory: [${CLOUDSDK_CONFIG}] Active Configuration Name: [default] Active Configuration Path: [${CLOUDSDK_CONFIG}/configurations/config_default]

Account: [n..r@g..m] Project: [c..6]

Current Properties: [compute] zone: [europe-west1-b] region: [europe-west1] [core] account: [n..r@g..m] disable_usage_reporting: [False] project: [c..6]

Logs Directory: [${CLOUDSDK_CONFIG}/logs] Last Log File: [${CLOUDSDK_CONFIG}/logs/2021.08.16/17.45.00.387484.log]

git: [git version 2.30.1 (Apple Git-130)] ssh: [OpenSSH_8.1p1, LibreSSL 2.7.3]

I have updated the gcloud SDK. Tried on MacOS and Windows but I've got stuck at the point of creating the topics.