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

Unable to view uploaded file #583

Open
dhirschfeld opened this issue Jan 3, 2023 · 4 comments
Open

Unable to view uploaded file #583

dhirschfeld opened this issue Jan 3, 2023 · 4 comments

Comments

@dhirschfeld
Copy link
Contributor

I was testing out uploading a file with quetz-client upload <channel-url> <package-name> which appeared to work - no error on the command line and I can see 1 package in my test channel

image

Logs from quetz:

image


When I try to view the package I get an Internal Server Error:

image

...with a pydantic error about the package version:

pydantic.error_wrappers.ValidationError: 1 validation error for PackageVersion
INFO:     10.244.2.35:33870 - "GET /api/paginated/channels/seau-dev/packages/seau-tns-dashboards-demo/versions?1672710642171 HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/base.py", line 106, in __call__
    response = await self.dispatch_func(request, call_next)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/quetz/main.py", line 160, in dispatch
    response = await call_next(request)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/base.py", line 80, in call_next
    raise app_exc
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/base.py", line 69, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/base.py", line 106, in __call__
    response = await self.dispatch_func(request, call_next)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/quetz/metrics/middleware.py", line 83, in dispatch
    raise e from None
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/quetz/metrics/middleware.py", line 75, in dispatch
    response = await call_next(request)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/base.py", line 80, in call_next
    raise app_exc
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/base.py", line 69, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/sessions.py", line 86, in __call__
    await self.app(scope, receive, send_wrapper)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/fastapi/routing.py", line 235, in app
    raw_response = await run_endpoint_function(
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/opt/mambaforge/envs/quetz/lib/python3.10/site-packages/quetz/main.py", line 1075, in get_paginated_package_versions
    version_data = rest_models.PackageVersion.from_orm(version)
  File "pydantic/main.py", line 579, in pydantic.main.BaseModel.from_orm
pydantic.error_wrappers.ValidationError: 1 validation error for PackageVersion
uploader
  none is not an allowed value (type=type_error.none.not_allowed)

I'm not sure where the None is coming from as the UI seems to display the version (0.2.0.post008+1356817) fine at the top-level

@dhirschfeld
Copy link
Contributor Author

Let me know if you want any more info - I'm happy to help debug the problem, just not too sure where to start...

@dhirschfeld
Copy link
Contributor Author

Poking around the db, things look ok?

quetz.sqlite> select * from packages
***************************[ 1. row ]***************************
name         | seau-tns-dashboards-demo
channel_name | seau-dev
description  | n/a
summary      | n/a
channeldata  | {"activate.d": false, "binary_prefix": false, "deactivate.d": false, "description": null, "dev_url": null, "doc_source_url": null, "doc
_url": null, "home": null, "icon_hash": null, "icon_url": null, "identifiers": {}, "keywords": {}, "license": null, "post_link": false, "pre_link": fa
lse, "pre_unlink": false, "run_exports": {}, "source_git_url": null, "source_url": null, "subdirs": ["noarch"], "summary": null, "tags": {}, "text_pre
fix": false, "timestamp": 1672710229, "version": "0.2.0.post008+1356817"}
platforms    | noarch
url          | <null>
1 row in set
Time: 0.000s
quetz.sqlite> select * from package_versions
***************************[ 1. row ]***************************
id             | 0x488a853623d741cd8dcb3e37fb04d759
channel_name   | seau-dev
package_name   | seau-tns-dashboards-demo
package_format | conda
platform       | noarch
version        | 0.2.0.post008+1356817
build_string   | pyh2e92cda_0
build_number   | 0
version_order  | 0
filename       | seau-tns-dashboards-demo-0.2.0.post008+1356817-pyh2e92cda_0.conda
info           | {"arch": null, "build": "pyh2e92cda_0", "build_number": 0, "depends": ["adlfs  ", "azure-identity  ", "azure-storage-blob  ", "azure-
storage-file-datalake  >=12.8.0", "fastapi  ", "fsspec  ", "hypercorn  ", "ipython  ", "orjson  ", "panel  ", "perspective  ", "perspective-python  ",
 "plotly  ", "polars  ", "pyarrow  ", "pyodbc  ", "python", "python-duckdb  ", "sqlalchemy  ", "trio  ", "trio-util  ", "turbodbc  "], "md5": "7f57307
917fbd9f1ebbc5a2533325746", "name": "seau-tns-dashboards-demo", "noarch": "python", "platform": null, "sha256": "0e1f60426255278b5846045e0488094f2a336
653cbb8f3451e772ba1b78bf01e", "size": 10097, "subdir": "noarch", "timestamp": 1672710229290, "version": "0.2.0.post008+1356817"}
uploader_id    | 0x09f15cb108b1495c94dd417348dc9f2a
time_created   | 2023-01-03 05:09:28
time_modified  | 2023-01-03 05:09:28
size           | 10097
download_count | 0
1 row in set
Time: 0.000s

@dhirschfeld
Copy link
Contributor Author

quetz.sqlite> select * from users
+------------------------------------+-------------------+--------+
| id                                 | username          | role   |
+------------------------------------+-------------------+--------+
| 0x32aca2c961fc4f149d12ae18590140a2 | dhirschfeld       | owner  |
| 0x09f15cb108b1495c94dd417348dc9f2a | <null>            | <null> |
+------------------------------------+-------------------+--------+
2 rows in set
Time: 0.005s

Right. I think I need to login to the quetz-client before uploading. Will look into that...

@dhirschfeld
Copy link
Contributor Author

As a data point, uploading via the swagger UI works and I can browse the package info:

image

...so, it seems to be an issue with quetz-client.

There doesn't appear to be any way to login with the client, but I assume it would just get the details from API key (which I verified was being used) 🤔

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

1 participant