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

phantomjs leaks out of the sandbox #351

Closed
AustinSchuh opened this issue Apr 2, 2019 · 13 comments · Fixed by #353
Closed

phantomjs leaks out of the sandbox #351

AustinSchuh opened this issue Apr 2, 2019 · 13 comments · Fixed by #353

Comments

@AustinSchuh
Copy link
Contributor

AustinSchuh commented Apr 2, 2019

When I run tests on Debian Buster, I get the following failure:

140302110000960: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
140302110000960:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
140302110000960:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
140302110000960:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

From some targeted stracing, I'm seeing that the phantomjs binary is reading /etc/ssl/openssl.cnf. Buster upgrades openssl far enough that the config in /etc/ is too different and won't work. The correct fix is to provide an openssl.cfg with phantomjs that works.

This is blocking a debian upgrade for us, so I'll likely dig in and try to provide a fix.

AustinSchuh pushed a commit to AustinSchuh/rules_closure that referenced this issue Apr 2, 2019
Debian buster ahs changed /etc/ssl/openssl.cnf far enough that the
openssl built into phantomjs can't parse it.  I found this out by
stracing a test run and watching it access /etc/ssl/openssl.cnf.  We
want bazel to not rely on anything outside the sandbox.  The error that
is returned otherwise is:

140302110000960: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
140302110000960:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
140302110000960:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
140302110000960:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

Fixes: bazelbuild#351
AustinSchuh added a commit to AustinSchuh/rules_closure that referenced this issue Apr 2, 2019
Debian buster ahs changed /etc/ssl/openssl.cnf far enough that the
openssl built into phantomjs can't parse it.  I found this out by
stracing a test run and watching it access /etc/ssl/openssl.cnf.  We
want bazel to not rely on anything outside the sandbox.  The error that
is returned otherwise is:

140302110000960: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
140302110000960:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
140302110000960:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
140302110000960:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

Fixes: bazelbuild#351
laurentlb pushed a commit that referenced this issue Apr 30, 2019
Debian buster ahs changed /etc/ssl/openssl.cnf far enough that the
openssl built into phantomjs can't parse it.  I found this out by
stracing a test run and watching it access /etc/ssl/openssl.cnf.  We
want bazel to not rely on anything outside the sandbox.  The error that
is returned otherwise is:

140302110000960: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
140302110000960:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
140302110000960:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
140302110000960:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

Fixes: #351
@impalanichamy
Copy link

got this error when chack the version of phantomjs in my debian system

Auto configuration failed
139888421578688: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
139888421578688:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139888421578688:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139888421578688:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

@saikumar-everest
Copy link

Any solution to this yet?

@AustinSchuh
Copy link
Contributor Author

My fixes were submitted in 2019. It was enough for me to operate on Debian Buster where I couldn't before.

@olastor
Copy link

olastor commented May 10, 2021

Related Issue and hacky workaround: aisingapore/TagUI#787 (comment)

@tobia
Copy link

tobia commented Jun 4, 2021

Even quicker version of the hacky workaround:

export OPENSSL_CONF=/dev/null

@JorgeLNH
Copy link

Thanks tobia, it worked.

@kcs-santoshahire
Copy link

kcs-santoshahire commented Nov 15, 2021

I was also facing same issue,

Thanks @tobia its worked..!

@meiremans
Copy link

meiremans commented Nov 29, 2021

thanks @tobia

adding ENV OPENSSL_CONF=/dev/null to a Dockerfile based on node:16 will make phantomjs work again.

Small sidenote here. PhantomJS will stop accepting HTTPS images. you can workaround this by passing --ignore-ssl-errors=yes.

@karthikeyaGit61
Copy link

karthikeyaGit61 commented May 4, 2022

export OPENSSL_CONF=/dev/null This is working but is not a permanent solution. I
am getting this again and again after closing the terminal. Is there any permanent solutions? @tobia

@dbauszus-glx
Copy link

I was able to solve this by installing openssl 3.0.3 from source and switch to node v18+

The problem occured for me when I upgraded from Ubuntu 21.10 to 22.04

tribbloid pushed a commit to tribbloid/spookystuff that referenced this issue May 12, 2022
tribbloid pushed a commit to tribbloid/spookystuff that referenced this issue May 20, 2022
… efficiently

Lifespan initialization after shipping is rewritten to be more reliable

CleanWebDriver now has more resilient clean up impl

all printing in integration tests are either removed or replaced with logging

default console log level changed to WARN

Simplify NOTSerializable

aggregate validateBeforeAndAfterAll

instancesShouldBeClean condition is improved to check Compound types

MAX_TOTAL_MEMORY set to 8

TestHelper lifespan changed to use Hadoop ShutdownHookManager

reorganize Lifespan impls

several unit test no longer relies on manual check

Lifespan of Session changed to TaskOrJVM

test-reports now also list failed tests at the end

add --webdriver-loglevel=ERROR into phantomJS cli option

update session progress before & after driver dispatching

Remove a lock in Cleanable that may cause deadlock

upgrade sizzle to the latest

BroadcastWrapper won't run cleanup if SparkContext is stopped

2 shell/maven has been removed for being inefficient: set -e, --fail-at-end

add envvar to bypass bazelbuild/rules_closure#351 in ubuntu 22.04+

proxy conf of PhantomJS & HtmlUnit selenium drivers are unified
zeclab added a commit to zeclab/guacamole-auth-radius that referenced this issue Oct 10, 2022
Added line "export OPENSSL_CONF=/dev/null && \" otherwise it wouldn't compile.
Found out why here "bazelbuild/rules_closure#351"

Also VERSION variable was not working on the copy command. Added "ARG VERSION"
@62015021
Copy link

Error: html-pdf: Unknown Error
Auto configuration failed

at ChildProcess.respond (/home/chayanin/sale-invoice-a4/node_modules/html-pdf/lib/pdf.js:134:17)
at ChildProcess.emit (node:events:513:28)
at ChildProcess._handle.onexit (node:internal/child_process:293:12)

Error: html-pdf: Unknown Error
Auto configuration failed

me run in server help plz

ptmphuong pushed a commit to ptmphuong/rules_closure that referenced this issue Dec 9, 2022
Debian buster ahs changed /etc/ssl/openssl.cnf far enough that the
openssl built into phantomjs can't parse it.  I found this out by
stracing a test run and watching it access /etc/ssl/openssl.cnf.  We
want bazel to not rely on anything outside the sandbox.  The error that
is returned otherwise is:

140302110000960: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
140302110000960:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
140302110000960:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
140302110000960:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

Fixes: bazelbuild#351
@wyvern800
Copy link

wyvern800 commented Dec 13, 2022

export OPENSSL_CONF=/dev/null This is working but is not a permanent solution. I am getting this again and again after closing the terminal. Is there any permanent solutions? @tobia

Thank you so much!, saved me and my co-workers life, really worked for us to have it working!

@42510SR
Copy link

42510SR commented Jun 20, 2024

i tried this export OPENSSL_CONF=/dev/null but it didnt worked , what is the issue like why i am getting this "Error: html-pdf: Received the exit code '1'\nhtml-pdf: Evaluation - ReferenceError: Can't find variable: $\nStack:\n at undefined\n"

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

Successfully merging a pull request may close this issue.