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

Likely Javascript Error #225

Open
ayjayt opened this issue Nov 15, 2024 · 1 comment
Open

Likely Javascript Error #225

ayjayt opened this issue Nov 15, 2024 · 1 comment
Assignees
Labels
active TNG related to next-generation architecture

Comments

@ayjayt
Copy link
Collaborator

ayjayt commented Nov 15, 2024

I also have a daily GHA failing this AM, due to picking up Kaleido 0.4.1. I've "fixed" it by pinning to 0.2.1.

File /opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/plotly/basedatatypes.py:3835, in BaseFigure.write_image(self, *args, **kwargs)
   3775 """
   3776 Convert a figure to a static image and write it to a file or writeable
   3777 object
   (...)
   3831 None
   3832 """
   3833 import plotly.io as pio
-> 3835 return pio.write_image(self, *args, **kwargs)

File /opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/plotly/io/_kaleido.py:296, in write_image(fig, file, format, scale, width, height, validate, engine)
    286         raise ValueError(
    287             """
    288 The 'file' argument '{file}' is not a string, pathlib.Path object, or file descriptor.
   (...)
    291             )
    292         )
    293     else:
    294         # We previously succeeded in interpreting `file` as a pathlib object.
    295         # Now we can use `write_bytes()`.
--> 296         path.write_bytes(img_data)

File /opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/pathlib.py:[106](https://github.com/hudcostreets/nj-crashes/actions/runs/11858949522/job/33050751493#step:19:107)6, in Path.write_bytes(self, data)
   1062 """
   1063 Open the file in bytes mode, write to it, and close the file.
   1064 """
   1065 # type-check for the buffer interface before truncating the file
-> 1066 view = memoryview(data)
   1067 with self.open(mode='wb') as f:
   1068     return f.write(view)

TypeError: memoryview: a bytes-like object is required, not 'NoneType'

Apologies if this should be its own issue, the error msg looks slightly similar to the last one above (something is None where it shouldn't be).

Originally posted by @ryan-williams in #223

@ayjayt
Copy link
Collaborator Author

ayjayt commented Nov 15, 2024

Hi @ryan-williams, sorry for your error.

The other issue is likely a matter of installing or running chrome/chromium (we no longer include it by default- its huge and updates too frequently), but I think your error may be different.

If you'd like me to help you debug it and/or send a fix to Kaleido, please set env var KALEIDO_DEBUG=true and run it again- although looking at your GHA, it may very well be that you need to add a line about installing chrome/ium.

I'm not 100% sure what the best way to install chrome is through GHA- we're doing it through snap (apt install) but there may be a faster method by curling from a google server.

@ayjayt ayjayt self-assigned this Nov 15, 2024
@ayjayt ayjayt added TNG related to next-generation architecture active labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active TNG related to next-generation architecture
Projects
None yet
Development

No branches or pull requests

1 participant