I am currently developing my first meteor app ever, still quite new. I tried implementing this package to add file uploads.
Locally it worked great, no problems. But as soon as I deploy via meteor up it fails saying "invalid ELF header".
Without the meteor-files package it works fine, but as soon as I add the package and do nothing else but importing it, the error happens.
I am deploying to an Ubuntu Server running Plesk via Meteor Up:
CPU | Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz (2 core(s))
-- | --
Version | Plesk Obsidian v18.0.31_build1800201106.13 os_Ubuntu 18.04
OS | Ubuntu 18.04.5 LTS
Here the error message:
------------------------------------STDERR------------------------------------
.node: invalid ELF header
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1208:18)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Module.Mp.load (/built_app/programs/server/runtime.js:15:31)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/dist/Easy.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Module.Mp._compile (/built_app/programs/server/runtime.js:50:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Module.Mp.load (/built_app/programs/server/runtime.js:15:31)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/dist/Curl.js:15:16)
=> Starting meteor app on port:80
/built_app/programs/server/node_modules/fibers/future.js:280
throw(ex);
^
Error: /built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/lib/binding/node_libcurl.node: invalid ELF header
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1208:18)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Module.Mp.load (/built_app/programs/server/runtime.js:15:31)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/dist/Easy.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Module.Mp._compile (/built_app/programs/server/runtime.js:50:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Module.Mp.load (/built_app/programs/server/runtime.js:15:31)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/dist/Curl.js:15:16)
=> Starting meteor app on port:80
/built_app/programs/server/node_modules/fibers/future.js:280
throw(ex);
^
Error: /built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/lib/binding/node_libcurl.node: invalid ELF header
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1208:18)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Module.Mp.load (/built_app/programs/server/runtime.js:15:31)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/dist/Easy.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Module.Mp._compile (/built_app/programs/server/runtime.js:50:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Module.Mp.load (/built_app/programs/server/runtime.js:15:31)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/dist/Curl.js:15:16)
=> Redeploying previous version of the app
Any help would be greatly appreciated
@ixam1 It really depends from how you build and deploy the app. Since you're using MUP I'd look into how it build the application, for example you need:
node-gyp and node-pre-gyp are installed;Error seems to be originating from request-libcurl dependency, here's its known issues ā https://github.com/VeliovGroup/request-extra#2-compiled-against-different-nodejs-version
Hope that helps, let me know if you require further assistance
And I'd start with simply building meteor app locally or on remote server, perhaps issue is in the build process
First of all thanks for the insanely quick reply.
I installed node-gyp and node-pre-gyp, didnt work.
I never needed to install node js I thought it comes with meteor? The same on the server. The App is running in docker, never installed node.
Error seems to be originating from
request-libcurldependency, here's its known issues ā https://github.com/VeliovGroup/request-extra#2-compiled-against-different-nodejs-version
I tried those steps. Also didnt work, it says I need to install Python?
npm rebuild --update-binary --build-from-source
> [email protected] install ...\node_modules\bcrypt
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
A new version of MUP was just released (2 hours ago), it now says _Node 14.1.0 - 14.15 is not supported. Please use a different Node version._. But again how do I change those versions? As I never installed node in the first place. I just installed Chocolatey and then meteor in Windows 10.
Building locally with meteor build works, but I dont know how to run the built tar.
Any other ideas? Thanks for your help again š
Actually I“m stupid I DID install node js. I installed 14.X. Now I changed to 12.8.4 (same as the current meteor version).
The warning from MUP (Node 14.1.0 - 14.15 is not supported. Please use a different Node version.) is gone, but still the same invalid ELF header error...
You missed so many details, like running on windows, in your OP it says Ubuntu, which won't change a thing since you mentioned a Docker. That made me thinking Ubuntu is you're dev environment.
Anyways, I've never crossed my paths with Windows, I know it may require many additionally installed stuff to get work done.
meteor node -v then select docker/mup release matching node version used by meteormeteor --version, if you're not on the latest release, select meteor-files version where yours meteor release version mentioned in release notes (on this repo)Hope that helps, good luck š
So hey I tried many things and I played around with versions alot.
I finally tried (randomly) to downgrade ostrio:files to v1.14.0 and now its working.
To clarify again I am using the following:
Newest meteor version 1.11.1
Deploying with Meteor up using abernix/meteord Docker image with the newest version 12.6.1
So apparently v1.14.1/2/3+ introduced a bug, that breaks this kind of setup?
I am just leaving it on v1.14.0 for now.
@ixam1
As I said before your Node version doesn't match. As you point out your Docker image using [email protected]
In terminal:
$ meteor --version
Meteor 1.11.1
$ meteor node -v
v12.18.4
Required Node version v12.18.4, you're running on v12.16.1.
ostrio:[email protected] work for you as it was build for [email protected], hope that's clear.
Feel free to close it in case if the issue is solved on your end.
Ah okay, so basically if you want to deploy with meteor up, your left with no other choice then to downgrade this package, as mup currently at latest supports node v12.6.1.
Yeah the issue is solved then, thank you for your help!
@ixam1 mup is 3rd party package, @abernix maintains 3rd party container, sometimes one or more components are outdated.
To make sure environment has 100% matching requirements I always recommend to manage deployments on your own.
I put best Meteor DevOps practices in this documentation -- https://github.com/veliovgroup/meteor-snippets/blob/main/devops/README.md
Hope it would help you.
Please support this project with:
For now I will stick with mup, as I am just starting and I am happy I got it working at all. But should more issues arise later, I will definitely check it out, thanks!
@dr-dimitru I'm sorry to report that I'm getting the exact same symptoms as reported by @ixam1.
I'm running:
Windows 10
Meteor 1.12
Node 12.18.4
npm 6.14.5
Everything runs and builds fine on Windows, but when I install the build on Ubuntu, I get this when I start node under Forever:
Error: /home/ubuntu/bundles/keeptrack/bundle/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/lib/binding/node_libcurl.node: invalid ELF header
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1187:18)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Module.Mp.load (/home/ubuntu/bundles/keeptrack/bundle/programs/server/runtime.js:15:31)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/ubuntu/bundles/keeptrack/bundle/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/dist/Easy.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Module.Mp._compile (/home/ubuntu/bundles/keeptrack/bundle/programs/server/runtime.js:50:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Module.Mp.load (/home/ubuntu/bundles/keeptrack/bundle/programs/server/runtime.js:15:31)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/ubuntu/bundles/keeptrack/bundle/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/node-libcurl/dist/Curl.js:15:16)
error: Forever detected script exited with code: 1
error: Script restart attempt #40
BTW you should know that in this build, I added ostrio:files to my system in order to support CSV import. I had successfully used ostrio:files earlier in a system a couple of years ago, but now I'm trying to use it in an updated system with React et al.
I attempted to downgrade ostrio:files but I got the same symptom.
EDIT: I've set up a local Ubuntu 20.04 OS on VMWare, I installed Meteor, cloned my code from GitHub and built. Ubuntu build works perfectly. While this is a possible circumvention, because of my workflow, building through Ubuntu has significant cost, so if you can give an guidance to either resolve or circumvent this on Windows I'd appreciate it.
My understanding is that this is actually an issue with libcurl, and @dr-dimitru you seem to understand this. The only thing that I don't understand is that my environment on Windows matches in all respects with the target OS, so I'm stumped.
ON EDIT:
I believe this is a problem with the Meteor build process, I've created this issue for MDG:
Just for reference, had the same problem with node v12.20.1 on both Win and Ubuntu. Downgrading to 1.4.0 solved the issue.
And the build is 6 MB smaller. So there seems to be a lot more packages to be included after 1.4.0 (haven't tested 1.4.1/2 though).
@sotarules good news v2.0.0 is out! This issue should get fixed. Sorry for make you waiting for this.
Let me know if v2.0.0 work for you
@dr-dimitru thanks so much for fixing this I'm trying it right now. @olafthiele take note.
@dr-dimitru it worked, but I'm curious what did you do? When I looked in the build log, there was no mention of libcurl at all; yet, the Windows-built bundle installed and works cleanly on Ubuntu.
BTW I got caught by the deprecation of streams: dynamic the the upload file module, but I removed it and it seems to work.
@sotarules I'm glad upgrade went almost smooth for you š
As stated in changelog -- request-libcurl was replaced with meteor/fetch library.
Sorry, late to the party, problem gone now with meteor 2.1 (didn't try 2.0)
@olafthiele thank you for update. I'm glad this was solved on your end.