jgraph / docker-drawio

Dockerized draw.io based on whichever is the most secure image at the time.
GNU General Public License v3.0
1.48k stars 359 forks source link

Export to PDF issues with the self-contained version #100

Closed ovizii closed 11 months ago

ovizii commented 1 year ago

I'm trying to get the self-contained version running and when trying to export to pdf I see these errors in the lgos of the server-export container:

warn: Handled exception: Could not find Chromium (rev. 1083080). This can occur if either                                                            
 1. you did not perform an installation before running the script (e.g. `npm install`) or                                                            
 2. your cache path is incorrectly configured (which is: /usr/local/drawio/.cache/puppeteer).                                                        
For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration. req=ip=10.10.10.1 format=pdf w=0 h=0 bg=%23ffffff  {"stack":"Error: Could not find Chromium (rev. 1083080). This can occur if either\n 1. you did not perform an installation before running the script (e.g. `npm install`) or\n 2. your cache path is incorrectly configured (which is: /usr/local/drawio/.cache/puppeteer).\nFor (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.\n    at ChromeLauncher.resolveExecutablePath (/usr/local/drawio/draw-image-export2/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:127:27)\n    at ChromeLauncher.executablePath (/usr/local/drawio/draw-image-export2/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:205:25)\n    at ChromeLauncher.launch (/usr/local/drawio/draw-image-export2/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:93:37)\n    at async handleRequest (/usr/local/drawio/draw-image-export2/export.js:554:17)"}                                                                                                                                         
::ffff:172.16.35.3 - - [03/Feb/2023:20:26:39 +0000] "POST / HTTP/1.1" 500 - "https://diagrams.mydomain.tld/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"  

The browser just shows: image

This is my docker-compose.yml

version: '2.4'

services:

# https://github.com/jgraph/docker-drawio/tree/dev/self-contained

  drawio:
    image: jgraph/drawio:latest
    container_name: drawio
    hostname: drawio
    restart: "no"
    environment:
      - DRAWIO_SELF_CONTAINED=1
      - PLANTUML_URL=http://drawio-plantuml-server:8080/
      - EXPORT_URL=http://drawio-export-server:8000/
      - DRAWIO_BASE_URL=https://diagrams.mydomain.tld/
      - DRAWIO_VIEWER_URL=https://diagrams.mydomain.tld/js/viewer.min.js
      - DRAWIO_LIGHTBOX_URL=https://diagrams.mydomain.tld/
    cpus: 1               
    mem_limit: 1G         
    networks:
      - drawio                 
      - traefik                   
    labels:                         
      - "traefik.enable=true"                  
      - "traefik.docker.network=traefik"                  
      - "traefik.http.routers.drawio.tls=true"                 
      - "traefik.http.routers.drawio.entrypoints=websecure"
      - "traefik.http.routers.drawio.middlewares=secHeaders@file"                 
      - "traefik.http.routers.drawio.rule=Host(`diagrams.mydomain.tld`)"
      - "traefik.http.routers.drawio.service=drawio"                
      - "traefik.http.services.drawio.loadbalancer.server.port=8080"

  drawio-plantuml-server:
    image: jgraph/plantuml-server
    container_name: drawio-plantuml-server
    hostname: drawio-plantuml-server
    expose:
      - "8080"
    networks:
      - drawio
    volumes:
      - /usr/share/fonts:/usr/share/fonts

  drawio-export-server:
    image: jgraph/export-server
    container_name: drawio-export-server
    hostname: drawio-export-server
    expose:
      - "8000"
    networks:
      - drawio
    volumes:
      - /usr/share/fonts:/usr/share/fonts
    environment:
      - DRAWIO_SERVER_URL=https://diagrams.mydomain.tld/

networks:
    traefik:            
        external: true        
        name: traefik            
    drawio:            
        external: true            
        name: drawio
ghost commented 1 year ago

Identical issue going on with my setup as well.

IamTaoChen commented 1 year ago

I have the same question

m-mohamedin commented 11 months ago

We've pushed a new image with a fix. Please give it a try

paulboony commented 9 months ago

@m-mohamedin The issue is still not yet resolved. There is another issue raised here, https://github.com/jgraph/docker-drawio/issues/128. Could you investigate, please?

davidjgraph commented 9 months ago

@paulboony please do not direct our team to perform tasks. This is a free integration, people don't always have free time to look at issues.

From https://github.com/jgraph/docker-drawio/blob/dev/CODE_OF_CONDUCT.md "Public or private harassment, including focusing on individual developers when a topic should be broadly addressed."