plotly / orca

Command line application for generating static images of interactive plotly charts
MIT License
292 stars 40 forks source link

Intermittent / internet related? 'Uncaught ReferenceError: Plotly is not defined' #379

Open tbarchyn opened 3 years ago

tbarchyn commented 3 years ago

Running orca in a docker container - version 1.3.1. We are seeing intermittent problems with the orca server not producing images, and requests from plotly timing out. When this happens orca is completely broken and cannot be fixed until the container is restarted.

The docker logs show the following error:

{"severity":"ERROR","textPayload":"renderer error - Uncaught ReferenceError: Plotly is not defined"}

On the other end, in plotly, we get a 522 socket timeout error - from reviewing the plotly code, this suggests the request went in to the orca server, but nothing came back.

OSError: 522: client socket timeout

The system works the vast majority of the time - only rare instances does it fail. These failures possibly relate to poor internet and do occur repeatedly in the same location (with poor internet). Orca works flawlessly with no internet at all, and flawlessly with good internet.

Possibly related to #232 - however, the containers work most of the time - it is only rare situations do we see these failures.

The container was built with the following docker-compose entry:

orca:
    image: quay.io/plotly/orca
    ports:
      - "9091:9091"
    healthcheck:
      test: ["CMD", "curl", "--fail", "http://localhost:9091"]
      interval: 60s
      timeout: 5s
      retries: 2
    restart: always
    network_mode: "host"
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"

For reference, networking seems to be all good. The server is responding to network requests, networking seems to be working, logs show a steady stream of json parse errors from health checks. Same occurs when hitting localhost:9091 in the browser.

{"severity":"ERROR","textPayload":"422 - json parse error","labels":{}}

Thank you for any advice!

nicolaskruchten commented 3 years ago

I'm sorry not to have any great answer to your specific question, but in general we are recommending that folks switch from using Orca to using Kaleido, which is our new and much-less-finicky static-image export system. More info at https://medium.com/plotly/introducing-kaleido-b03c4b7b1d81