question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error loading shared library libstdc++.so.6

See original GitHub issue

Hi,

CoreOS 1068.8.0 (Stable) here, with Docker Server Version: 1.10.3.

I run mitmproxy (dev), the latest version from the docker hub, with this command: docker run --rm -it mitmproxy/mitmproxy:dev

This is what I get:

Traceback (most recent call last):
File "/usr/bin/mitmproxy", line 9, in <module>
load_entry_point('mitmproxy==0.18', 'console_scripts', 'mitmproxy')()
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
return ep.load()
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3.5/site-packages/mitmproxy/main.py", line 9, in <module>
from mitmproxy import cmdline
File "/usr/lib/python3.5/site-packages/mitmproxy/cmdline.py", line 9, in <module>
from mitmproxy import filt
File "/usr/lib/python3.5/site-packages/mitmproxy/filt.py", line 40, in <module>
from mitmproxy.models.http import HTTPFlow
File "/usr/lib/python3.5/site-packages/mitmproxy/models/__init__.py", line 3, in <module>
from netlib.http import decoded
File "/usr/lib/python3.5/site-packages/netlib/http/__init__.py", line 2, in <module>
from netlib.http.request import Request
File "/usr/lib/python3.5/site-packages/netlib/http/request.py", line 13, in <module>
from netlib.http import message
File "/usr/lib/python3.5/site-packages/netlib/http/message.py", line 8, in <module>
from netlib import encoding, strutils, basetypes
File "/usr/lib/python3.5/site-packages/netlib/encoding.py", line 11, in <module>
import brotli
File "/usr/lib/python3.5/site-packages/brotli/__init__.py", line 2, in <module>
from .brotli import decompress, Decompressor, compress # noqa
File "/usr/lib/python3.5/site-packages/brotli/brotli.py", line 4, in <module>
from ._brotli import ffi, lib
ImportError: Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/lib/python3.5/site-packages/brotli/_brotli.cpython-35m-x86_64-linux-gnu.so)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
mhilscommented, Aug 3, 2016

I hate binary dependencies 😛

Our docker image now explicitly installs libstdc++ so that removing g++ should be ok. Dockerhub is building - @eriktux, could you check again once all builds are completed at https://hub.docker.com/r/mitmproxy/mitmproxy/builds/?

Thanks for looking into this @Lukasa! 😃

1reaction
Lukasacommented, Aug 3, 2016

Actually, I no longer think this is the fault of the wheels.

Paging @mhils, as this is almost certainly related to mitmproxy/mitmproxy#1451. Good to see you again so soon @mhils!

So when you added brotlipy as a dependency, you also implicitly added a binary dependency on libstdc++.so.6. This is because brotlipy ships a chunk of C++ code as part of libbrotli. That’s not normally a problem because most Linux systems have libstdc++.so.6 on them already, but it looks like the mitmproxy docker image does an apk del g++ after it installs all the Python images. That will almost certainly blow away libstdc++.so.6, which means that brotlipy will no longer be able to execute.

I suspect updating your docker container to keep libstdc++.so.6 around will resolve this problem neatly.

I’d also like to tag @njsmith here: given this problem here, how do you feel about having libstdc++.so in the list of libraries that manylinux1 assumes will be present?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error loading shared library libstdc++.so.6 · Issue #33
I am using docker-java in an application that runs inside a container, to access the host /var/run/docker.sock (mounted as ...
Read more >
Docker run Error loading shared library libstdc++.so.6 and ...
I`m getting this error: Error loading shared library libstdc++.so.6: No such file or directory (needed by /app/erts-12.0.2/bin/beam.smp) ...
Read more >
docker run Error loading shared library libstdc++.so.6 and ...
I found that just adding libstdc++ specifically worked for me (I was already installing openssl and ncurses-libs but didn't need anything else).
Read more >
18.04 - Error loading shared libraries: libstdc++.so.6
1 Answer 1 · Sudo apt is not working. – Jigyansha · Sudo dpkg above gives error " package libstdc++6:amd64 8.4.0~18.04 cannot be...
Read more >
Airflow
Error loading shared library libstdc ++.so.6: No such file or directory (needed by /usr/lib/python3.6/site-packages/pandas/_libs/window.cpython- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found