h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 323 forks source link

Wave fetch throws an error #2177

Closed mturoci closed 8 months ago

mturoci commented 8 months ago

Wave SDK Version, OS

1.0.0

Actual behavior

Using wave fetch throws

Fetching examples and related files. Please wait...
Downloading https://github.com/h2oai/wave/releases/download/v1.0.0/wave-1.0.0-macosx_12_0_arm64-arm64.tar.gz
Traceback (most recent call last):
  File "/Users/mturoci/projects/tmp/venv/bin/wave", line 8, in <module>
    sys.exit(main())
  File "/Users/mturoci/projects/tmp/venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mturoci/projects/tmp/venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/mturoci/projects/tmp/venv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/mturoci/projects/tmp/venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/mturoci/projects/tmp/venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/mturoci/projects/tmp/venv/lib/python3.10/site-packages/h2o_wave/cli.py", line 211, in fetch
    request.urlretrieve(tar_url, tar_file)
  File "/Users/mturoci/.asdf/installs/python/3.10.10/lib/python3.10/urllib/request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/Users/mturoci/.asdf/installs/python/3.10.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/mturoci/.asdf/installs/python/3.10.10/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/Users/mturoci/.asdf/installs/python/3.10.10/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/Users/mturoci/.asdf/installs/python/3.10.10/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/Users/mturoci/.asdf/installs/python/3.10.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/Users/mturoci/.asdf/installs/python/3.10.10/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Expected behavior

(A clear and concise description of what you expected to happen.)

Steps To Reproduce

  1. Do this
  2. Do that
  3. Do something else
  4. See error
YashasviMantha commented 8 months ago

https://github.com/h2oai/wave/blob/main/py/h2o_wave/h2o_wave/cli.py

Seems like the url is not being correctly built.

mturoci commented 8 months ago

Feel free to take up on this @YashasviMantha if you feel like.

YashasviMantha commented 8 months ago

@mturoci sure. So I did some investigation, and it indeed seems like the problem is being caused because the url is incorrectly being generated:

Downloading https://github.com/h2oai/wave/releases/download/v1.0.0/wave-1.0.0-macosx_12_0_arm64-arm64.tar.gz

This url is being generated from here.

And since the platform and arch gets created on build time from the metadata.py which is hard coded to linux on the make file here.

I cant see in which scenario the platform and arch are macosx_12_0_ and arm. I think the wave fetch is being triggered by somewhere else but not sure where. Am I going on the right direction?

mturoci commented 8 months ago

You are going in the good direction. Seems like this is caused by https://github.com/h2oai/wave/pull/2073 (I overlooked the platform/arch params).

The code that needs to be fixed is here. Metadata.py gets generated during the py build. Feel free to ping me either here or on discord in case you have more questions.