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

When export PDF it crash (version 2.5.3) #1862

Open
36huo opened this issue Mar 24, 2024 · 3 comments
Open

When export PDF it crash (version 2.5.3) #1862

36huo opened this issue Mar 24, 2024 · 3 comments

Comments

@36huo
Copy link

36huo commented Mar 24, 2024

docker-compose file

version: "3"
services:
  database:
    image: postgres:11.6-alpine
    environment:
      - POSTGRES_USER=codimd
      - POSTGRES_PASSWORD=XXX
      - POSTGRES_DB=codimd
    volumes:
      - "./data/database:/var/lib/postgresql/data"
    restart: always
  codimd:
    image: hackmdio/hackmd:2.5.3
    environment:
      - CMD_DB_URL=postgres://codimd:XXX@database/codimd
      - CMD_PROTOCOL_USESSL=false
      - QT_QPA_PLATFORM=

    depends_on:
      - database
    ports:
      - "3000:3000"
    volumes:
      - ./data/upload:/home/hackmd/app/public/uploads

logs

2024-03-24T14:42:45.731Z error:         uncaughtException: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
Auto configuration failed
139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

Error: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
Auto configuration failed
139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
2024-03-24T14:42:45.731Z error:         An uncaught exception has occured.
2024-03-24T14:42:45.731Z error:         Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
Auto configuration failed
139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

2024-03-24T14:42:45.734Z error:         Process will exit now.
Error: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
Auto configuration failed
139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: '/home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000',
  level: 'error',
  timestamp: '2024-03-24T14:42:45.731Z',
  [Symbol(level)]: 'error',
  [Symbol(message)]: '2024-03-24T14:42:45.731Z error: \tCommand failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000\n' +
    'Auto configuration failed\n' +
    '139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory\n' +
    '139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:\n' +
    '139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf\n' +
    '139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf\n'
}
@36huo
Copy link
Author

36huo commented Mar 24, 2024

I add - OPENSSL_CONF=/etc/ssl/ to environment ,then the function export pdf returns to normal.

@H-B-Schmidt
Copy link

Here PDF download crashes with a different error (2.5.3)

This application failed to start because it could not find or load the Qt platform plugin "offscreen".

2024-03-28T08:39:20.068Z error:         uncaughtException: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35cN7C20mELfC1.html /tmp/tmp-35P4ICXwFmojGW.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
This application failed to start because it could not find or load the Qt platform plugin "offscreen".

Available platform plugins are: phantom.

Reinstalling the application may fix this problem.
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

Error: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35cN7C20mELfC1.html /tmp/tmp-35P4ICXwFmojGW.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
This application failed to start because it could not find or load the Qt platform plugin "offscreen".

Available platform plugins are: phantom.

Reinstalling the application may fix this problem.
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
2024-03-28T08:39:20.068Z error:         An uncaught exception has occured.
2024-03-28T08:39:20.068Z error:         Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35cN7C20mELfC1.html /tmp/tmp-35P4ICXwFmojGW.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
This application failed to start because it could not find or load the Qt platform plugin "offscreen".

Available platform plugins are: phantom.

Reinstalling the application may fix this problem.
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

Error: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35cN7C20mELfC1.html /tmp/tmp-35P4ICXwFmojGW.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
This application failed to start because it could not find or load the Qt platform plugin "offscreen".

Available platform plugins are: phantom.

Reinstalling the application may fix this problem.
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: null,
  killed: false,
  signal: 'SIGABRT',
  cmd: '/home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35cN7C20mELfC1.html /tmp/tmp-35P4ICXwFmojGW.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000',
  level: 'error',
  timestamp: '2024-03-28T08:39:20.068Z',
  [Symbol(level)]: 'error',
2024-03-28T08:39:20.069Z error:         Process will exit now.
  [Symbol(message)]: '2024-03-28T08:39:20.068Z error: \tCommand failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35cN7C20mELfC1.html /tmp/tmp-35P4ICXwFmojGW.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000\n' +
    'This application failed to start because it could not find or load the Qt platform plugin "offscreen".\n' +
    '\n' +
    'Available platform plugins are: phantom.\n' +
    '\n' +
    'Reinstalling the application may fix this problem.\n' +
    'PhantomJS has crashed. Please read the bug reporting guide at\n' +
    '<http://phantomjs.org/bug-reporting.html> and file a bug report.\n'
}

@H-B-Schmidt
Copy link

H-B-Schmidt commented Mar 28, 2024

I had to add both settings to fix the two problems.

      - QT_QPA_PLATFORM=
      - OPENSSL_CONF=/etc/ssl
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants