question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lambda Boto3 “Unknown service: 'sqs'”

See original GitHub issue

I’ve just written a Python Lambda function which does some MySQL stuff and then sends a message off to SQS. This all works fine locally and the message is sent to SQS successfully.

I am creating an SQS Client like so:

sqsClient = boto3.client('sqs')

However, after deploying my packaged Lambda function to AWS and running the built-in Lambda test feature. I get the following error:

{
  "errorMessage": "Unknown service: 'sqs'. Valid service names are: ",
  "errorType": "UnknownServiceError",
  "stackTrace": [
    "  File \"/var/lang/lib/python3.7/imp.py\", line 234, in load_module\n    return load_source(name, filename, file)\n",
    "  File \"/var/lang/lib/python3.7/imp.py\", line 171, in load_source\n    module = _load(spec)\n",
    "  File \"<frozen importlib._bootstrap>\", line 696, in _load\n",
    "  File \"<frozen importlib._bootstrap>\", line 677, in _load_unlocked\n",
    "  File \"<frozen importlib._bootstrap_external>\", line 728, in exec_module\n",
    "  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n",
    "  File \"/var/task/main.py\", line 20, in <module>\n    sqsClient = boto3.client('sqs')\n",
    "  File \"/var/task/boto3/__init__.py\", line 91, in client\n    return _get_default_session().client(*args, **kwargs)\n",
    "  File \"/var/task/boto3/session.py\", line 263, in client\n    aws_session_token=aws_session_token, config=config)\n",
    "  File \"/var/task/botocore/session.py\", line 838, in create_client\n    client_config=config, api_version=api_version)\n",
    "  File \"/var/task/botocore/client.py\", line 79, in create_client\n    service_model = self._load_service_model(service_name, api_version)\n",
    "  File \"/var/task/botocore/client.py\", line 117, in _load_service_model\n    api_version=api_version)\n",
    "  File \"/var/task/botocore/loaders.py\", line 132, in _wrapper\n    data = func(self, *args, **kwargs)\n",
    "  File \"/var/task/botocore/loaders.py\", line 378, in load_service_model\n    known_service_names=', '.join(sorted(known_services)))\n"
  ]
}

My initial thought was that maybe the Lambda version of boto3 doesn’t include SQS yet. I don’t think this is the issue though as I am deploying my own version of boto and botocore. I’ve also added the following lines in my function to ensure Lambda is using my deployed version of boto and and not it’s inbuilt version:

print("boto3 version:"+boto3.__version__)
print("botocore version:"+botocore.__version__)

Which is outputting the following versions:

boto3 version:1.9.87
botocore version:1.12.87

These are correct and the same as my local versions.

Any help would be appreciated. Thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
andyfurniss4commented, Feb 8, 2019

botocore.session.get_session().get_available_services()) is not outputting anything on the live Lambda.

Can you see what might be wrong with my deployment process?

0reactions
no-response[bot]commented, Feb 16, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Lambda Boto3 "Unknown service: 'sqs'" - Stack Overflow
AWS Lambda Boto3 "Unknown service: 'sqs'" ... I've just written a Python Lambda function which does some MySQL stuff and then sends a ......
Read more >
Aws Codepipeline Custom Lambda Function Runs ... - ADocLib
Invoke an AWS Lambda function in a pipeline in CodePipeline This procedure ... Aws Lambda Boto3 "Unknown Service: 'Sqs'" · Xmlhttprequest - Aws...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found