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

AttributeError: 'NoneType' object has no attribute 'get' #1070

Open
hugbubby opened this issue Mar 10, 2025 · 1 comment
Open

AttributeError: 'NoneType' object has no attribute 'get' #1070

hugbubby opened this issue Mar 10, 2025 · 1 comment

Comments

@hugbubby
Copy link

Bug description

Getting an "AttributeError" when batching a transaction.

How to reproduce

  1. Create a complicated, large batched transaction.
  2. Result:
Traceback (most recent call last):
  File "/app/pwn/pwn_service.py", line 1288, in process_scan
    await txb.commit()
  File "/usr/local/lib/python3.12/site-packages/prisma/client.py", line 764, in commit
    await self.__client._engine.query(
  File "/usr/local/lib/python3.12/site-packages/prisma/engine/_query.py", line 402, in query
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/prisma/engine/_http.py", line 233, in request
    return self._process_response_data(data=data, response=response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/prisma/engine/_http.py", line 87, in _process_response_data
    return utils.handle_response_errors(response, errors_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/prisma/engine/utils.py", line 167, in handle_response_errors
    kind = user_facing.get('meta', {}).get('kind')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
``

It's clear the code expects the 'meta' to return {} or the current object, but not None, which has apparently been inserted in that tag.

## Expected behavior

No panics.

## Prisma information

Can't share more information on the database schema. Can dm it to a source maintainer if you are here.

@sigridjineth
Copy link

I got the same issue

  File "/Users/sigridjineth/Desktop/work/elyn/elyn-server/.venv/lib/python3.11/site-packages/prisma/engine/utils.py", line 167, in handle_response_errors
    kind = user_facing.get('meta', {}).get('kind')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

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

2 participants