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

File removing error in App store #1557

Closed
ShehanIshanka opened this issue Jul 26, 2022 · 0 comments · Fixed by #1558
Closed

File removing error in App store #1557

ShehanIshanka opened this issue Jul 26, 2022 · 0 comments · Fixed by #1558
Assignees
Labels
bug Bug in code server Related to server

Comments

@ShehanIshanka
Copy link

Wave SDK Version, OS

0.21.1

Actual behavior

I am using q.site.unload function to remove files from f folder. In AppStore, it provides an error as below.

{"error":"invalid file path","path":"/instance/0eecb492-0acd-42da-8f2c-307923802a6a/_f/3ad81d52-c716-472d-8dc9-8dd0db8cd802/dai_lgbm_mojo.zip","t":"file_unload"}

Then after investigating, I found that Wave expects file path url to begin with /_f . This path is returned from wave upload component and we provide it to q.site.unload function.

image (1)

The reason for additional part (/instance/0eecb492-0acd-42da-8f2c-307923802a6a/) in file path url is because of H2O_WAVE_BASE_URL ENV variable where in app store it is /instance/0eecb492-0acd-42da-8f2c-307923802a6a/. H2O_WAVE_BASE_URL is used for path-based routing.

Then I did another change in the code to remove the additional part (/instance/0eecb492-0acd-42da-8f2c-307923802a6a/) and pass only /_f/3ad81d52-c716-472d-8dc9-8dd0db8cd802/dai_lgbm_mojo.zip to q.site.unload function.
Then the app was stuck and got the following error.

Traceback (most recent call last):
  File "./src/app.py", line 40, in serve
    if not await handle_on(q):
  File "/resources/venv/lib/python3.7/site-packages/h2o_wave/routing.py", line 179, in handle_on
    if await _match_predicate(predicate, func, arity, q, arg_value):
  File "/resources/venv/lib/python3.7/site-packages/h2o_wave/routing.py", line 129, in _match_predicate
    await _invoke_handler(func, arity, q, arg)
  File "/resources/venv/lib/python3.7/site-packages/h2o_wave/routing.py", line 117, in _invoke_handler
    await func(q)
  File "./src/mlops/handlers/experiments/add_experiment_handler.py", line 55, in experiment_file_upload
    await q.site.unload(get_unload_file_path(uploaded_file))
  File "/resources/venv/lib/python3.7/site-packages/h2o_wave/core.py", line 832, in unload
    raise ServiceError(f'Unload failed (code={res.status_code}): {res.text}')
h2o_wave.core.ServiceError: Unload failed (code=404): 404 page not found

So it seems that when you send without instance ID, there is no handler for it and you get a 404.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code server Related to server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants