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 ld-linux-x86-64.so.2: No such file or directory

See original GitHub issue

How frequently does the bug occur?

All the time

Description

It was working on with all the same server setup but it’s started giving this error when we tried to deployed this on production. dev and production both are having same configuration with OS ubuntu. I almost spent 3 days and tried everything to fix it. linux-x86-64.so.2 is already available on /usr/lib64 but still giving the error however on dev it’s working fine. Please help.

Stacktrace & log output

ERROR Error in phase start: Could not run init tasks: Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/src/app/node_modules/realm/build/Release/realm.node)

Can you reproduce the bug?

Yes, always

Reproduction Steps

No response

Version

10.14

What SDK flavour are you using?

MongoDB Realm (i.e. Sync, auth, functions)

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Ubuntu 20

Build environment

NodeJs

Cocoapods version

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Firanuscommented, Oct 13, 2022

We actually experienced the same problem when trying to build and run a Docker container of our node realm app.

The error ended up being that our container was built on node:gallium-alpine, and the alpine image either didn’t contain the required library or couldn’t find it. We tried also tried to use node:gallium, and that found the library, but gave a different error, namely:

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /app/node_modules/realm/build/Release/realm.node)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1210:18)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at Module.Hook.Module.require (/app/node_modules/dd-trace/packages/dd-trace/src/ritm.js:73:33)
    at require (node:internal/modules/cjs/helpers:102:18)
    at bindings (/app/node_modules/bindings/bindings.js:112:48)
    at getRealmConstructor (/app/node_modules/realm/lib/index.js:28:37)
    at Object.<anonymous> (/app/node_modules/realm/lib/index.js:53:26)
    at Module._compile (node:internal/modules/cjs/loader:1126:14) {
  code: 'ERR_DLOPEN_FAILED'
}

Basically, the version of glibc that node:16 ships wasn’t up-to-date enough.

The solution to all this ended up being to move to building our docker images using node 18. The alpine images still lacked the requisite lib, but using FROM node:18-slim solved our problem. 😄

0reactions
aandeacommented, Oct 20, 2022

@Firanus , Thank you for the solution. I had the same problem (with node:16.14). Confirm that the fix works (move to 18-slim). Weird, since the 16.14 image is supposed to include the needed dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error loading shared library ld-linux-x86-64.so.2 on Alpine
#32 115.7 Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/src/app/node_modules/@next/swc- ...
Read more >
lib64/ld-linux-x86-64.so.2: No such file or directory error
If the elasticsearch distribution you are trying to install is for x86_64, then it attempts to link to the x86-64-native ld.so, ...
Read more >
Error loading shared library ld-linux-x86-64.so.2 - Julien Voisin
Error loading shared library ld-linux-x86-64.so.2: on Alpine Linux. Sat 04 April 2020 — download. Since I've encountered this issue so much, here is...
Read more >
Error loading shared library ld-linux-x86-64.so.2 while running ...
This is a copy/paste of an issue opened on github at https://github.com/CNES/WASP/issues/11 Hello, I'm using WASP to get some cloud free...
Read more >
Solving The “Cannot Open Shared Object File - Baeldung
In this tutorial, we'll go through various causes and fixes for the “cannot open shared object file: No such file or directory” error...
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