Unstructured-IO / Unstructured-IO/unstructured-api

401 response (API key) with local docker hosted server

Open
#456 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
951
Forks
192
Avg merge
7d 8h
Merged PRs (30d)
2

Description

Describe the bug
Trying to use a local hosted server from the docker container and accessing with the python api. I get a 401 error API key is missing, please provide an API key in the header". This is the same as #407 except the solution there didn't fix it for me.

To Reproduce
Ubuntu 20.04
docker pull downloads.unstructured.io/unstructured-io/unstructured-api:latest
docker run -p 8000:8000 -d --rm --name unstructured-api downloads.unstructured.io/unstructured-io/unstructured-api:latest

then in python:

client = unstructured_client.UnstructuredClient(
    server='free-api',
    server_url=os.getenv("http://0.0.0.0:8000/general/v0/general"),
)
# insert quick start example request here
res = client.general.partition(request=req)  # this raises the error `SDKError: API error occurred: Status 401`

Contributor guide

Open the contributing guide

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

Start by reproducing the issue with the documented Docker pull and run commands, then inspect the Python UnstructuredClient configuration and compare it with issue #407. Done means the local container accepts the Python client's general.partition request without returning a 401 missing-API-key error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.