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

PyQS is not supporting localstack/ElasticMQ #84

Open
amirraouf opened this issue Apr 15, 2022 · 0 comments
Open

PyQS is not supporting localstack/ElasticMQ #84

amirraouf opened this issue Apr 15, 2022 · 0 comments

Comments

@amirraouf
Copy link

I need to run PyQS with local sqs implementation, everything is going right till I need to call a task delayer, it raises the problem of

/usr/local/lib/python3.8/site-packages/pyqs/decorator.py in wrapper(*args, **kwargs)
     32 
     33     def wrapper(*args, **kwargs):
---> 34         queue = get_or_create_queue(queue_name)
     35 
     36         _delay_seconds = delay_seconds

/usr/local/lib/python3.8/site-packages/pyqs/decorator.py in get_or_create_queue(queue_name)
     14     sqs = boto3.resource('sqs', region_name=region_name)
     15     try:
---> 16         return sqs.get_queue_by_name(QueueName=queue_name)
     17     except ClientError as exc:
     18         non_existent_code = 'AWS.SimpleQueueService.NonExistentQueue'

/usr/local/lib/python3.8/site-packages/boto3/resources/factory.py in do_action(self, *args, **kwargs)
    518             # instance via ``self``.
    519             def do_action(self, *args, **kwargs):
--> 520                 response = action(self, *args, **kwargs)
    521 
    522                 if hasattr(self, 'load'):

/usr/local/lib/python3.8/site-packages/boto3/resources/action.py in __call__(self, parent, *args, **kwargs)
     81                     operation_name, params)
     82 
---> 83         response = getattr(parent.meta.client, operation_name)(*args, **params)
     84 
     85         logger.debug('Response: %r', response)

/usr/local/lib/python3.8/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
    335                     "%s() only accepts keyword arguments." % py_operation_name)
    336             # The "self" in this scope is referring to the BaseClient.
--> 337             return self._make_api_call(operation_name, kwargs)
    338 
    339         _api_call.__name__ = str(py_operation_name)

/usr/local/lib/python3.8/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
    654             error_code = parsed_response.get("Error", {}).get("Code")
    655             error_class = self.exceptions.from_code(error_code)
--> 656             raise error_class(parsed_response, operation_name)
    657         else:
    658             return parsed_response

ClientError: An error occurred (InvalidClientTokenId) when calling the GetQueueUrl operation: The security token included in the request is invalid.

The sol.:
At get_or_create_queue, the resource doesn't take endpoint url, which will solve the issue of preparing the sqs resource, while it been specified at the PyQS main call --endpoint-url

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

No branches or pull requests

1 participant