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

ValueError: too many values to unpack in application startup when deployed as a Knative service on Kubernetes #607

Closed
devdattakulkarni opened this issue Oct 3, 2023 · 4 comments

Comments

@devdattakulkarni
Copy link

We have a stac-fastapi application, which we want to run on Kubernetes as a Knative service (serverless). We have containerized our application and it runs as expected when we deploy it on K8s using a standard Kubernetes Deployment resource. But the same application image, when deployed as a Knative serverless service, encounters an exception. Here is the exception stack trace:

Defaulted container "user-container" out of: user-container, queue-proxy INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit) too many values to unpack (expected 2) NoneType: None INFO: 192.168.81.115:0 - "GET / HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__ return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 270, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 124, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__ raise exc File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/site-packages/stac_fastapi/api/middleware.py", line 62, in __call__ proto, domain, port = self._get_forwarded_url_parts(scope) File "/usr/local/lib/python3.10/site-packages/stac_fastapi/api/middleware.py", line 95, in _get_forwarded_url_parts key, value = part.split("=") ValueError: too many values to unpack (expected 2)

Any suggestions/pointers towards debugging the error will be very helpful.

Tagging other Kubernetes-related issues in case others have seen this error #399 #412

@devdattakulkarni
Copy link
Author

Here are the versions of the various libraries that I am installing via requirements.txt

stac_pydantic==2.0.*
stac-fastapi.types==2.4.3
stac-fastapi.api==2.4.3
stac-fastapi.extensions==2.4.3

@jonhealy1
Copy link
Collaborator

Hi @devdattakulkarni. Any progress with this?

@devdattakulkarni
Copy link
Author

Hi @jonhealy1 We are not using Knative service now - instead going with standard Kubernetes Deployment. With that, we have not encountered this error.

@jonhealy1
Copy link
Collaborator

Good to hear. Thanks for the quick reply

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