Atom fails to start correctly. In the Atom developer console, an error "Module did not self-register" is printed, along with a stack trace (below).
I can reproduce this on my system by running nix-shell -p atom --pure, and running Atom from that shell.
Error: Module did not self-register.
at Error (native)
at process.module.(anonymous function) [as dlopen] (ATOM_SHELL_ASAR.js:159:20)
at Object.Module._extensions..node (module.js:450:18)
at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:170:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/node_modules/text-buffer/node_modules/pathwatcher/lib/main.js:6:13)
at Object.<anonymous> (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/node_modules/text-buffer/node_modules/pathwatcher/lib/main.js:218:4)
at Module._compile (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .js] (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:9:10)
at Object.<anonymous> (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1482:4)
at Module._compile (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .js] (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/project.js:18:16)
at Object.<anonymous> (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/project.js:529:4)
at Module._compile (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .js] (/nix/store/miwnxwjzghfqsfzkpqyk35g9lbm6h7di-atom-1.8.0/share/atom/resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
For completeness, let's link #15267 .
I would also be interested in a fix for this, as any Atom past 1.6.2 has been unusable for me.
Btw, @mythmon if you need some version of Atom, this will work:
( lib.overrideDerivation atom (attrs: {
name = "atom-1.6.2";
src = fetchurl {
url = "https://github.com/atom/atom/releases/download/v1.6.2/atom-amd64.deb";
sha256 = "1kl2pc0smacn4lgk5wwlaiw03rm8b0763vaisgp843p35zzsbc9n";
name = "atom-1.6.2.deb";
};
}))
Thanks @NeQuissimus that override works well for me.
@mythmon Do you have your configuration.nix somewhere? I wonder if we have some overlaps that could cause this. Mine is here: https://github.com/NeQuissimus/DevSetup/blob/master/ux305c.nix
My current configuration.nix is here: https://gist.github.com/mythmon/3379f21dff463e0652936b77166c46ce. That also includes a list of packages installed with nix-env -q
Would you try https://github.com/NixOS/nixpkgs/pull/17611 ?
Upgrading Atom to 1.9.6 as in #17611 fixes this problem for me. @NeQuissimus, does this fix the problem for you too?
Just tested it, the issue persists for me. I am on the latest nixpkgs-unstable-small channel as of right now
Can confirm the issue and I cannot find any logs and don't have any output which could help debug the error.
I'm not sure what happened, but I have this problem again. I think the update to 1.9.6 wasn't really fix, and I just have something else going on.
I have this problem too with the latest unstable. After messing with it for a while, I realized if I built it locally (instead of using the binary cache) it worked fine. I did nix-build '<nixpkgs>' -A atom --check to rebuild and now it just works. I don't know why hydra is producing bad builds.
FWIW the "module did not self-register" error usually means there's a mismatch between the node version and the compiled version of a c module. I would assume that in this case, patchelf or something is mangling the module so it doesn't load, since a mismatched node version seems unlikely.
@bdimcheff That is interesting insight. I will try that out when I have a chance and see if I can confirm this.
Building locally worked for me as well. This would explain why updating the version worked for me earlier: I beat the hydra cache.
hmmm, so for me v1.9.9 built locally was still not working.
But pushing up to v1.10.1 now works after I built locally...
I just hit this after switching from nix channel 16.03 to 16.09, Atom v1.9.9.
Slightly different trace for me:
index.js:62 Error: Module did not self-register.
at Error (native)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:158:20)
at Object.Module._extensions..node (module.js:440:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:169:18)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/node_modules/text-buffer/node_modules/pathwatcher/lib/main.js:6:13)
at Object.<anonymous> (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/node_modules/text-buffer/node_modules/pathwatcher/lib/main.js:218:4)
at Module._compile (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .js] (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:9:10)
at Object.<anonymous> (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1533:4)
at Module._compile (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .js] (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/project.js:18:16)
at Object.<anonymous> (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/project.js:549:4)
at Module._compile (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .js] (/nix/store/46kaqnnabrv9v67xysibl3sk3cch2c76-atom-1.9.9/share/atom/resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)handleSetupError @ index.js:62window.onload @ index.js:45
I am starting to wonder if the best way of fixing this may be to use node2nix and build Atom from source. However, the Atom build is a little convoluted and I have no experience with node.js. I didn't quite get the hang of it when I took a quick shot at building Atom v1.10.2 from source. Any takers? :D
I just updated atom to 1.10.1 in unstable, so lets see what hydra does with that.
Fair enough, I thought 1.10.2 was the latest version?
Will try this tomorrow.
It was 1.10.1 when I made the PR yesterday, but they did indeed release 2 versions in 2 days :-/
(triage) Any update on this ? Atom seems to be working now
Ah yes, it seems the newer versions no longer exhibit this behaviour