contentful-management.py icon indicating copy to clipboard operation
contentful-management.py copied to clipboard

Getting a 404 when creating a new entry

Open stevefusaro opened this issue 2 years ago • 2 comments

I'm suddenly getting a 404 when creating a new entry. I'm not sure what could have changed, the last time I successfully ran this code was months ago. The entry create function takes an entry id but when I call it I get an error saying the entry id could not be found.

The code

self.client\
    .entries(self.SPACE_ID, self.ENV_ID)\
    .create(str(uuid.uuid4()), attributes)

The error

Traceback (most recent call last):
  File "src/handle_changes.py", line 55, in <module>
    main()
  File "src/handle_changes.py", line 52, in main
    handle_changes(past_versions, differ, contentful_api)
  File "src/handle_changes.py", line 26, in handle_changes
    api_sys_id = contentful_api.get_or_create_api(api_id)
  File "/repo/src/contentful_service.py", line 147, in get_or_create_api
    api = self.management_api.create_api_entry(api_id)
  File "/repo/src/contentful_service.py", line 59, in create_api_entry
    api = self.client\
  File "/pyenv/versions/3.8.10/lib/python3.8/site-packages/contentful_management/entries_proxy.py", line 72, in create
    return super(EntriesProxy, self).create(resource_id=resource_id, attributes=attributes)
  File "/pyenv/versions/3.8.10/lib/python3.8/site-packages/contentful_management/client_proxy.py", line 72, in create
    result = self.client._put(
  File "/pyenv/versions/3.8.10/lib/python3.8/site-packages/contentful_management/client.py", line 789, in _put
    return self._request('put', url, attributes, **kwargs)
  File "/pyenv/versions/3.8.10/lib/python3.8/site-packages/contentful_management/client.py", line 757, in _request
    raise error
contentful_management.errors.NotFoundError: HTTP status code: 404
Message: The resource could not be found.
Details: The requested Entry could not be found. ID: ae823fe8-e41e-408c-9da6-b45cd08d96ec.
Request ID: db9c022a-574e-487c-8e56-1abe40492e54

Update: I've had version 2.11.0 pinned since we started working on this

stevefusaro avatar Dec 09 '22 11:12 stevefusaro

@stevefusaro You are using the latest version so thats alright, I will check what can be the issue. Will keep you posted.

Cheers

rubydog avatar Dec 14 '22 07:12 rubydog

@stevefusaro Is this fixed or does the issue still persist?

rubydog avatar Oct 11 '23 10:10 rubydog