Week 5 Error pedia- Implement Conversations with DynamoDB
This post is a catalogue of (almost) every single error I fought through while following along the Week 5 tutorial lecture to implement the chat room functions using DynamoDB.
The errors are listed in chronological order, so it is possible that other campers met with one of the errors listed here might be greeted by other errors in a similar order.
This post is currently evolving to update all the solution to every single error listed here. I hope it helps.
Error
- On Messages page, the individual messages are not showing in the chat room. (Disclaimer: as of writing this blog post (May 14, 2023), I have NOT earned the red squad badge. It's just my imagination)
Error lists
UnboundLocalError: local variable 'ddb' referenced before assignment
botocore.errorfactory.ResourceNotFoundException: Cannot do operations on a non-existent table
psycopg_pool.PoolTimeout: couldn't get a connection after 30.0 sec
ValidationException - when calling the Query operation: Value provided in ExpressionAttributeValues unused in expressions: keys: {:year}
psycopg.OperationalError: consuming input failed: EOF detected
NameError: name 'extract_access_token' is not defined
flask_awscognito.exceptions.TokenVerifyError: Token is expired
AttributeError: 'db' object has no attribute 'extract_access_token'
WEM Error - Conversation content does not display when clicking on message group.
TypeError: 'NoneType' object is not subscriptable
401 Unauthorized - NOT fetch error
update_cognito_user_ids
TypeError: unhashable type: 'dict' (1)
SOLVED - return model (1)
1:08:43 Reverse sorting messages
- KeyError: 'credential_provider' (1)
Create message
TypeError: Cannot set property json of #<Object> which has only a getter (1)
TypeError: CreateMessage.run() missing 2 required positional arguments: 'user_sender_handle' and
'user_receiver_handle'
(1)
After creating new apis that create new message groups
When trying to create a new message group (chat room) by calling the api with a username:
botocore.errorfactory.ResourceNotFoundException: Requested resource not found (1)
TypeError: ddb.list_message_groups() missing 1 required positional argument: 'current_user_uuid'
TypeError: ddb.create_message() missing 1 required positional argument: 'table_name'
botocore.exceptions.ParamValidationError: Parameter validation failed:
Conversation is displayed across different chat rooms
Data is there (on AWS DynamoDB server). It's just NOT displaying on the webpage.
Need to verify...:
Is the app attempting to first "FETCH" the data? → Attempting to talk to the DB at all?
If yes, then where is it breaking so it fails to display it?
If not, then there is no link existing between the processes that make the data travel to the frontend. Where is it?