Open paulalex opened 1 week ago
Hi @paulalex, did you recently upgrade kaleido? There is a prelease version of kaleido out that might cause this error but you would only get it if you used pip install --pre kaleido
, it is not "officially" launched yet. Let me know what version you are using, it sounds like you are using a release candidate.
That said, I really appreciate this error report. The problem is that ubuntu/snap is now segmenting temporary files by process so that /tmp
no longer behaves as expected, nor can be used to share data between processes. I will try to improve the error output, but if you would like to continue using the new version please show me the line of code you use to call kaleido and I will help you enable debugging so I can see more context. Thank you!
Furthermore, @paulalex, the old version pulled in chromium on install but the new version asks you to install it yourself. Another reason you might stay with the old version, but the new version will ultimately be significantly faster for generating many images which may save you money on AWS Lambda.
We can also add an override for the tempfile path (/tmp
will again not work with snap) early this week on the new version.
@ayjayt Tomorrow I will get the production image from ECR and login in locally so I can print all of the dependencies out, I re-ran an existing report on prod and it built fine, so this is currently only happening in dev so I assume its dependency related.
I did try pinning to some versions at the top of the stack for Kaleido and plotly to see if it was as simple as the last version but that didn't work so I will need to dig deeper but I will report back with my findings tomorrow.
Thanks for the reply.
@ayjayt, I have looked at the requirements.txt file which is inside the container (generated from a pip file) and it has the following dependencies for kaleido
and plotly
:
kaleido==0.2.1
plotly==5.24.1;
However the dev environment image has the following dependencies (exactly as you assumed):
kaleido==0.4.0rc5
plotly==5.24.1
My pip file does have allow_prereleases = true
so I could fix this by setting this to false
and I am testing now with fixed dependencies and also this property set to false
. I would prefer not to have to pin to versions (irrespective of whether I do not allow pre releases) but I am unsure of the best path forwards right now, if you have any advice around how to successfully upgrade it would be much appreciated.
Hi! I think we will have some other options for you by tomorrow, maybe EOD today.
@paulalex, a new version of kaleido was pushed- it is not a rc so unless you pin, all your systems will use it. This version of kaleido requires chrome to be installed separately.
It now tries to detect if the user is using canonical's snap
- and if they are not it does normal /tmp
instead of /home/$USER/.tmpdir
. However, there is also now a KALEIDO_TMP_PATH
environmental variable which can override all other logic.
I have been using plotly and kaleido for generating reports in AWS lambda for well over a year now and its suddenly erroring on the report generation:
I do not reference
/home
anywhere and previously was not seeing this error. Is there any way I can override the use of/home
, I fixed tempfiles temp dir to/tmp
but this still does not stop the error. I do not understand why this has started happening out of the blue.