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

Tabler icons are not loaded anymore #78

Closed
thebino opened this issue Mar 19, 2024 · 8 comments · Fixed by #79
Closed

Tabler icons are not loaded anymore #78

thebino opened this issue Mar 19, 2024 · 8 comments · Fixed by #79

Comments

@thebino
Copy link
Contributor

thebino commented Mar 19, 2024

The loading of Tabler icons is failing with an not-found

 Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/keymap_drawer/draw/glyph.py", line 143, in _fetch_svg_url
    with urlopen(url) as f:
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/usr/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.10/urllib/request.py", line 557, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 749, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/usr/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/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

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/.local/bin/keymap", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.local/lib/python3.10/site-packages/keymap_drawer/__main__.py", line 178, in main
    draw(args, config.draw_config)
  File "/home/runner/.local/lib/python3.10/site-packages/keymap_drawer/__main__.py", line 42, in draw
    drawer = KeymapDrawer(
  File "/home/runner/.local/lib/python3.10/site-packages/keymap_drawer/draw/draw.py", line 25, in __init__
    self.init_glyphs()
  File "/home/runner/.local/lib/python3.10/site-packages/keymap_drawer/draw/glyph.py", line 58, in init_glyphs
    self.name_to_svg |= self._fetch_glyphs(rest)
  File "/home/runner/.local/lib/python3.10/site-packages/keymap_drawer/draw/glyph.py", line 81, in _fetch_glyphs
    return dict(zip(names, p.map(fetch_fn, names, urls, timeout=FETCH_TIMEOUT)))
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 623, in result_iterator
    yield _result_or_cancel(fs.pop(), end_time - time.monotonic())
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
    return fut.result(timeout)
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/keymap_drawer/draw/glyph.py", line 151, in _fetch_svg_url
    raise ValueError(f'Could not fetch SVG from URL "{url}"') from exc
ValueError: Could not fetch SVG from URL "https://unpkg.com/@tabler/icons/icons/screenshot.svg"
ERROR: parsing or drawing failed for corne!
@thebino
Copy link
Contributor Author

thebino commented Mar 24, 2024

I tried today with the v0.14.0 and still see the issue. Did I miss the URL somewhere maybe?
https://github.com/thebino/zmk-config/actions/runs/8409574894/job/23027028090

@caksoylar
Copy link
Owner

Might be related to #81, I will test later today.

@caksoylar
Copy link
Owner

I published 0.14.1 with the fix in #82, can you try again?

@thebino
Copy link
Contributor Author

thebino commented Mar 25, 2024

Hmm. no still the old url in the logs 🤔

@caksoylar
Copy link
Owner

It seems to be working fine here, how are you testing? Maybe you have a config file that has the old value in it?

e.g. here it is in the web app that has 0.14.1 deployed: https://caksoylar.github.io/keymap-drawer?keymap_yaml=H4sIAAAAAAAC_0WLuw7CMAxF936Fh4ztANmyQT8DVZGbug_JxFIeVAjx76QV0OFKvsfnDgFX68SPy2TglSNZFodsHbqZDIzIkd4V41NyMhWAhDSLPTpAkDUa0PvthPPd77UoFOKmDDRi5q_dwE2phD1TMI_NJqVq-KM-LNOcPMXYDLL67Xdqu9_yfKnhfC05kC5IF6Tb7gNO9xadywAAAA%3D%3D

@thebino
Copy link
Contributor Author

thebino commented Mar 25, 2024

I don't know why but in the logs always the old url is showing up.
I've just changed a single key: thebino/zmk-config#7

See the full build logs
build.log

@caksoylar
Copy link
Owner

You can see here that your config file contains the old value: https://github.com/thebino/zmk-config/blob/9436835e7e4472ac840945ec427856d57fb12bc6/config_black/corne.yaml#L197

It would be good practice to remove any keys that you aren't intending to override from the config files. I am aware that the recommendation in the README is to dump-config and then edit, maybe that should be changed to prevent this kind of issue.

@thebino
Copy link
Contributor Author

thebino commented Mar 27, 2024

Thanks, I'm feeling stupid that I haven't found this. But now everything is working again

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

Successfully merging a pull request may close this issue.

2 participants