Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed service account email to None as the default service account was resulting in an invalid argument #817

Merged
merged 1 commit into from
Apr 17, 2021

Conversation

lordzuko
Copy link
Contributor

While trying to connect with the GCS bucket, I was able to successfully read the number of objects in the bucket, however, the data was not loading from the bucket. Following is the stack trace.

[2021-04-14 12:05:06,472] [core.utils.common::custom_exception_handler::85] [ERROR] 4c589210-8293-4c0e-a05f-4750defe5a9a Error calling the IAM signBytes API: b'{n "error": {n "code": 400,n "message": "Request contains an invalid argument.",n "status": "INVALID_ARGUMENT"n }\n}n'Traceback (most recent call last):File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatchresponse = handler(request, *args, **kwargs)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/label_studio/data_manager/api.py", line 133, in tasksreturn self.get_paginated_response(serializer.data)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/rest_framework/serializers.py", line 745, in dataret = super().dataFile "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/rest_framework/serializers.py", line 246, in dataself._data = self.to_representation(self.instance)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/rest_framework/serializers.py", line 663, in to_representationreturn [File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/rest_framework/serializers.py", line 664, in self.child.to_representation(item) for item in iterableFile "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/label_studio/tasks/serializers.py", line 149, in to_representationinstance.data = instance.resolve_uri(instance.data, proxy=self.context.get('proxy', False))File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/label_studio/tasks/models.py", line 135, in resolve_urireturn storage.resolve_task_data_uri(task_data)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/label_studio/io_storages/base_models.py", line 61, in resolve_task_data_uriresolved_uri = self.resolve_uri(data)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/label_studio/io_storages/gcs/models.py", line 159, in resolve_uriresolved_uri = self.resolve_gs(uri)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/label_studio/io_storages/gcs/models.py", line 103, in resolve_gsreturn self.python_cloud_function_get_signed_url(bucket_name, key)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/label_studio/io_storages/gcs/models.py", line 151, in python_cloud_function_get_signed_urlsigned_url = signed_blob_path.generate_signed_url(expires_at_ms, credentials=signing_credentials, version="v4")File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/google/cloud/storage/blob.py", line 551, in generate_signed_urlreturn helper(File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/google/cloud/storage/_signing.py", line 622, in generate_signed_url_v4signature_bytes = credentials.sign_bytes(string_to_sign.encode("ascii"))File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/google/auth/compute_engine/credentials.py", line 404, in sign_bytesreturn self._signer.sign(message)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/google/auth/iam.py", line 99, in signresponse = self._make_signing_request(message)File "/home/lordzuko/miniconda3/envs/label-studio/lib/python3.8/site-packages/google/auth/iam.py", line 81, in _make_signing_requestraise exceptions.TransportError(google.auth.exceptions.TransportError: Error calling the IAM signBytes API: b'{n "error": {n "code": 400,n "message": "Request contains an invalid argument.",n "status": "INVALID_ARGUMENT"n }\n}n'

Post switching to the default value to None, fixed the issue and I was able to successfully load images from the GCS bucket and save annotations to the GCS bucket.

Please let me know if there are more details I have to add to this Pull request.

@niklub niklub merged commit 3529ff5 into HumanSignal:master Apr 17, 2021
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

Unit Test Results

    1 files  +    1      1 suites  +1   4m 47s ⏱️ + 4m 47s
341 tests +341  265 ✔️ +265  76 💤 +76  0 ❌ ±0 

Results for commit 3529ff5. ± Comparison against base commit fff1de8.

@lordzuko lordzuko deleted the gcs_invalid_argument_fix branch April 18, 2021 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants