PDF Render issue on anvil-runtime

What I’m trying to do:
I am trying to render a pdf on my anvil app, running on an aws ec2 instance (OS Ubuntu 20.4)

google-chome, ghostscript, anvil-app-server all are updated to latest version.
python version is 3.8.10

It’s just a basic form with a label and an image.

What I’ve tried and what’s not working:
In my anvil hosted version it works.

But I am getting the following error on my aws hosted version

If you’ve faced something like this or know what causes this, please share how you’ve fixed it…

1 Like

Hi @rsmahmud,

Please can you share the log output of the App Server? That should contain more information about what’s going on. Thanks!

Hi @daviesian,

Thanks for your reply!

These are the logs recorded when I click the button from the client side to render the pdf.
The call doesn’t even go to the target form’s init method. It crashes before.

[ERROR anvil.app-server.run] Error report from client code:
JSONDecodeError: PDF generation failed: Expecting value: line 1 column 1 (char 0)
Traceback:
  /home/ubuntu/.local/lib/python3.8/site-packages/anvil_downlink_worker/anvil/pdf.py:17

  /home/ubuntu/.local/lib/python3.8/site-packages/anvil_downlink_worker/anvil/pdf.py:59

  /home/ubuntu/Gravital_CPQ/server_code/server_main.py:90

  app/Gravital_CPQ/Test/__init__.py:157

[DEBUG anvil.app-server.run] [CLIENT] Handling Error: PDF generation failed: Expecting value: line 1 column 1 (char 0)
Raising Error: PDF generation failed: Expecting value: line 1 column 1 (char 0)

Here is how the form looks,

Here is the server code,

It fails on line 90.

My guess is either anvil-app-server module or chrome is causing this. The problem is I don’t know exactly which combination of those versions would work! If you can provide some insight, It’d be a great help!

Thanks

Update:

PDF Render works with the following versions:

anvil-app-server==1.7.6
Google Chrome 96.0.4664.45

We seem to be encountering this issue with anvil-app-server==1.8.0. Is there a work around for the latest version now?

Hi @jon1. I’m sorry to hear you’re encountering this issue. We’re currently investigating and hope to fix it soon.

1 Like

Please let me know if we can assist in any way.

Any news on this issue? We haven’t been able to deploy v 1.8 to our production environment due to this.

Also having the same issue. anvil-app-server 1.8.0

Waiting for Anvil to fix.

1 Like

Any update on it yet?

1 Like

@patricia and Anvill Team,

Is there any news on this? We’re unable to upgrade our production environment due to this issue/bug. Is there any way that we can help to get it resolved as it has been 2 months.