Open-EO / Open-EO/openeo-python-driver

unsupported /files endpoint returns a 404 instead of a 501

Open
#263 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
Python
Stars
12
Forks
8
Avg merge
6d 3h
Merged PRs (30d)
4

Description

A user tried to upload a file with the Python client but this feature is not supported by the back-end and he got a 404 back:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/openeo/rest/connection.py", line 1488, in upload_file
    resp = self.put(f"/files/{target!s}", expected_status=200, data=f)
  File "/usr/local/lib/python3.9/site-packages/openeo/rest/connection.py", line 259, in put
    return self.request("put", path=path, data=data, headers=headers, allow_redirects=False, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/openeo/rest/connection.py", line 769, in request
    return _request()
  File "/usr/local/lib/python3.9/site-packages/openeo/rest/connection.py", line 762, in _request
    return super(Connection, self).request(
  File "/usr/local/lib/python3.9/site-packages/openeo/rest/connection.py", line 168, in request
    self._raise_api_error(resp)
  File "/usr/local/lib/python3.9/site-packages/openeo/rest/connection.py", line 188, in _raise_api_error
    raise OpenEoApiError(
openeo.rest.OpenEoApiError: [404] NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. (ref: r-2402229ec6924eceb2e402f908d9cd18)

This should have returned a 501 with code FeatureUnsupported instead.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the /files endpoint handling in the driver and compare it with other unsupported-feature responses. Reproduce the Python client's upload request, then verify that an unsupported endpoint returns HTTP 501 with the FeatureUnsupported code instead of 404.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.