Unable to run consumer and producer python files

Hi,

For the streaming ingestion lab, I’m trying to run the 2 python files for the consumer and producer on the cli at src/cli/:

  1. python consumer_from_cli.py --stream de-c2w2lab1-kinesis-data-stream-cli

Error: botocore.exceptions.NoCredentialsError: Unable to locate credentials errors

  1. python producer_from_cli.py --stream de-c2w2lab1-kinesis-data-stream-cli --json_string '{"session_id": "a1", "customer_number": 100, "city": "Washington", "country": "USA", "credit_limit": 1000, "browse_history": [ {"product_code": "Product1", "quantity": 2, "in_shopping_cart": true}, {"product_code": "Product2", "quantity": 1, "in_shopping_cart": false}]}

Error: {‘message’: ‘Error producing record’, ‘error’: ‘Unable to locate credentials’, ‘record’: {‘session_id’: ‘a1’, ‘customer_number’: 100, ‘city’: ‘Washington’, ‘country’: ‘USA’, ‘credit_limit’: 1000, ‘browse_history’: [{‘product_code’: ‘Product1’, ‘quantity’: 2, ‘in_shopping_cart’: True}, {‘product_code’: ‘Product2’, ‘quantity’: 1, ‘in_shopping_cart’: False}]}}

I noticed in my cloud9 that i do not have any AWS credentials in ~/.aws. Could this be the reason? How do i resolve this?

Thanks!

Hi @jkwd,
I tried the lab right now, and the python scripts are working. My ~/.aws folder is empty too. Did you create the Kinesis data stream as it is specified in step 1.1?

1 Like

Thank you for reporting this issue! The team has updated some configuration settings for this lab (that could be a fix to the problem you encountered). Could you please try again the lab? If you still have issues, please let us know the issues and the steps you followed before getting the issues. And we’ll forward them to the team.

1 Like

Hi both, I’m able to complete the assignment now. Thanks!

2 Likes