Symptom
When .crewai_user.json contains valid JSON whose root is not an object, tracing helpers raise AttributeError: 'list' object has no attribute 'get'.
Evidence what you'll see
- Writing
[]to.crewai_user.jsonand callinguser_data.has_user_declined_tracing()raises thatAttributeError. update_user_data({"trace_consent": False})then raises because a list has no.update()method.- The report's unmodified production helpers failed for array, null, bool, number, and string roots across status and update paths.
Why it happens
The shared user-data loader casts any successful json.loads() result to a dictionary without checking its shape. It already treats syntactically invalid JSON as empty data, but a JSON array or null is valid and still not a mapping.
Affected versions
macOS, Python 3.13.12, a uv workspace checkout at upstream main aa5f2acd9b. The linked issue does not name a released crewai version.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- With
.crewai_user.jsoncontaining[],has_user_declined_tracing()no longer raisesAttributeError: 'list' object has no attribute 'get', andupdate_user_data({"trace_consent": False})can write a preference.
If it still fails
- The issue says pull request 6649 covers UTF-8 read/write handling and does not validate the decoded root type.
- The linked issue does not give a one-line edit that recovers a file whose root is already a non-object.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it