arunoda / meteor-up-legacy

Production Quality Meteor Deployments
MIT License
2.26k stars 395 forks source link

[meteor 1.4] AssertionError: "undefined" === "function" #1091

Open WayneUong opened 8 years ago

WayneUong commented 8 years ago

Upgraded 1.3.5.1 to 1.4, it works fine locally, but when I deployed to EC2 using mupx

[52.35.45.35] x Verifying deployment: FAILED

-----------------------------------STDERR-----------------------------------
package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN cannot run in wd meteor-dev-bundle@0.0.0 node npm-rebuild.js (wd=/bundle/bundle/programs/server)
=> Starting meteor app on port:80

assert.js:93
  throw new assert.AssertionError({
        ^
AssertionError: "undefined" === "function"
    at wrapPathFunction (/bundle/bundle/programs/server/mini-files.js:77:10)
    at Object.<anonymous> (/bundle/bundle/programs/server/mini-files.js:108:24)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/bundle/bundle/programs/server/boot.js:9:13)
    at Module._compile (module.js:456:26)

=> Redeploying previous version of the app
catin-black commented 8 years ago

+1

kevinhattam commented 8 years ago

+1

bmanturner commented 8 years ago

Does mupx support that 'nodeVersion' option that mup did?

catin-black commented 8 years ago

Nope but using mup it does not work too

humbertocruz commented 8 years ago

+1

humbertocruz commented 8 years ago

the problem should be with the new node version (4.4.7) of meteor 1.4 with the docker image "meteord" that installs version 0.10.43

WayneUong commented 8 years ago

for anyone still looking for a solution: https://github.com/meteor/meteor/issues/7475

catin-black commented 8 years ago

Thx! I hope @arunoda will help us withoud hacks :)

tomtom87 commented 8 years ago

+1

mariushop commented 8 years ago

+1

patrickml commented 8 years ago

+1

francescomugnai commented 8 years ago

+1

humbertocruz commented 8 years ago

while waiting for the "official" fix, I changed the start.sh file of the mupx to use the docker image abernix/meteord:base and now it's working good

tima101 commented 8 years ago

+1

ogermann commented 8 years ago

+1

ArthurGerbelot commented 8 years ago

@WayneUong, I have the exact same problem than you (with mupx). I updated all node and meteor node (to 4.4.7) on both computer (prod and deploying, both on linux) and also updated as you mentioned my start.sh file (on production server /opt/appname/config. @humbertocruz: It's this one?) :

docker pull meteorhacks/meteord:base replaced by docker build -t abernix/meteord:app

And I still have the same error.

WayneUong commented 8 years ago

@ArthurGerbelot I highly recommend you switch to the new kadirahq/mup. It allows you to set the dockerImage setting so you don't have to mess with the source code. I use a custom mupx because I need to install wkhtmltopdf in addition to the abernix/meteord:base docker image.

humbertocruz commented 8 years ago

@ArthurGerbelot If you change this file on server it will work only until your next mupx deploy command. You need to change it on your dev machine. Mupx is installed in the node_modules directory of node. You have to change from meteorhacks/meteord:base to abernix/meteord:base in three places on the file.

humbertocruz commented 8 years ago

@WayneUong I tried the new kadirahq/mup but it is not working. After mup deploy nothing happens, no error message and no files on server. Since my apps was out for a longe time the hacked mupx seens to be my best option.

tobiasheckmann commented 8 years ago

@humbertocruz I searched for the start.sh file everywhere, but can´t find it. Also, I can´t locate the node directory, could you specify more where it should be if I used npm install -g mupx for installation.

tima101 commented 8 years ago

@arunoda Do you guys plan to update mupx to work with Meteor 1.4 ?

lyquocnam commented 8 years ago

+1

gg2001 commented 8 years ago

+1

yuwiggin commented 8 years ago

Did anyone have a sulotion? Thank you very much!

berkaytheunicorn commented 8 years ago

+1

SachaG commented 8 years ago

@tobiasheckmann here's how to locate the file. First, do which mupx to find the path to the mupx executable. For me it gives:

/Users/sacha/.nvm/versions/node/v4.2.1/bin/mupx

Which means the path to start.sh would be:

/Users/sacha/.nvm/versions/node/v4.2.1/lib/node_modules/mupx/templates/linux/start.sh
jcampana commented 8 years ago

+1

davidalonsobadia commented 8 years ago

+1

davidalonsobadia commented 8 years ago

Ok, so I fixed that error just updating my Node version of the server to 4.X.X. Then I restart it and the assertion error didn't show up again. I hope my advice can also help you guys.

nickredmark commented 8 years ago

+1

lovrozitnik commented 8 years ago

+1

owens2024 commented 8 years ago

+1

lovrozitnik commented 8 years ago

The problem seems to be the default docker image. User abernix kindly made a new, working one, so change mup.js settings to his new docker image:

{
  meteor: {
    dockerImage: 'abernix/meteord:base',
  },
}

Source: https://github.com/kadirahq/meteor-up/issues/172 (see abernix answer).

jykae commented 8 years ago

Could someone provide fix for this as PR to kadirahq, if issue is in base Docker image. Looks like the fix is not there yet https://github.com/kadirahq/meteor-up/blob/master/src/modules/meteor/assets/templates/start.sh

If that is the right file in kadirahq version, as @humbertocruz pointed out the file "start.sh"? Maybe we should move on to it finally..

ghaliano commented 8 years ago

Worked for me with : @humbertocruz recommandation changing node version to "nodeVersion": "4.5.0" in mup.json file mupx setup && mupx deploy

tima101 commented 8 years ago

@humbertocruz @SachaG Yep, all works now. Thanks!

You have to change from meteorhacks/meteord:base to abernix/meteord:base in three places on the file (start.sh).

/Users/sacha/.nvm/versions/node/v4.2.1/lib/node_modules/mupx/templates/linux/start.sh

richardmarais commented 8 years ago

I have searched my entire pc (Windows 10). I don't have a start.sh. Any ideas?

richardmarais commented 8 years ago

I ran the following in the meteor app dir, and it works now:

meteor update --all-packages

manufosela commented 8 years ago

Solution from 'lovrozitnik commented on 10 Aug' works.

Thanks @lovrozitnik :)

Tzikas commented 8 years ago

Thanks so much @humbertocruz & @SachaG /usr/local/lib/node_modules/mupx/templates/linux was where I found my start.sh

ryanple commented 8 years ago

2 hours of self-motivation trying to figure it out myself, finally caved in and googled and came across this.

If you're dev'ing on Ubuntu, @Tzikas path is correct; my start.sh was also at /usr/local/lib/node_modules/mupx/templates/linux

Cheers @humbertocruz!

triasrahman commented 8 years ago

any official solution?

hollerith commented 8 years ago

I think I am having this issue on heroku. Although I can only see a certain amount of the application logs.

2016-09-26T14:04:05.215189+00:00 heroku[web.1]: Starting process with command node build/bundle/main.js 2016-09-26T14:04:07.567084+00:00 heroku[web.1]: Process exited with status 8 2016-09-26T14:04:07.582561+00:00 heroku[web.1]: State changed from starting to crashed 2016-09-26T14:04:07.583518+00:00 heroku[web.1]: State changed from crashed to starting 2016-09-26T14:04:07.452052+00:00 app[web.1]: 2016-09-26T14:04:07.452506+00:00 app[web.1]: assert.js:93 2016-09-26T14:04:07.452914+00:00 app[web.1]: throw new assert.AssertionError({ 2016-09-26T14:04:07.452944+00:00 app[web.1]: ^ 2016-09-26T14:04:07.455613+00:00 app[web.1]: AssertionError: "undefined" === "function" 2016-09-26T14:04:07.455615+00:00 app[web.1]: at wrapPathFunction (/app/build/bundle/programs/server/mini-files.js:77:10) 2016-09-26T14:04:07.455616+00:00 app[web.1]: at Object. (/app/build/bundle/programs/server/mini-files.js:108:24) 2016-09-26T14:04:07.455616+00:00 app[web.1]: at Module._compile (module.js:456:26) 2016-09-26T14:04:07.455617+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10) 2016-09-26T14:04:07.455617+00:00 app[web.1]: at Module.load (module.js:356:32) 2016-09-26T14:04:07.455618+00:00 app[web.1]: at Function.Module._load (module.js:312:12) 2016-09-26T14:04:07.455619+00:00 app[web.1]: at Module.require (module.js:364:17) 2016-09-26T14:04:07.455619+00:00 app[web.1]: at require (module.js:380:17) 2016-09-26T14:04:07.455620+00:00 app[web.1]: at Object. (/app/build/bundle/programs/server/boot.js:9:13) 2016-09-26T14:04:07.455621+00:00 app[web.1]: at Module._compile (module.js:456:26) 2016-09-26T14:04:36.341183+00:00 heroku[web.1]: Starting process with command node build/bundle/main.js 2016-09-26T14:04:38.788382+00:00 heroku[web.1]: Process exited with status 8 2016-09-26T14:04:38.802828+00:00 heroku[web.1]: State changed from starting to crashed 2016-09-26T14:04:38.672389+00:00 app[web.1]: 2016-09-26T14:04:38.672860+00:00 app[web.1]: assert.js:93 2016-09-26T14:04:38.673232+00:00 app[web.1]: throw new assert.AssertionError({ 2016-09-26T14:04:38.673265+00:00 app[web.1]: ^ 2016-09-26T14:04:38.675656+00:00 app[web.1]: AssertionError: "undefined" === "function" 2016-09-26T14:04:38.675658+00:00 app[web.1]: at wrapPathFunction (/app/build/bundle/programs/server/mini-files.js:77:10) 2016-09-26T14:04:38.675659+00:00 app[web.1]: at Object. (/app/build/bundle/programs/server/mini-files.js:108:24) 2016-09-26T14:04:38.675659+00:00 app[web.1]: at Module._compile (module.js:456:26) 2016-09-26T14:04:38.675660+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10) 2016-09-26T14:04:38.675661+00:00 app[web.1]: at Module.load (module.js:356:32) 2016-09-26T14:04:38.675661+00:00 app[web.1]: at Function.Module._load (module.js:312:12) 2016-09-26T14:04:38.675662+00:00 app[web.1]: at Module.require (module.js:364:17) 2016-09-26T14:04:38.675662+00:00 app[web.1]: at require (module.js:380:17) 2016-09-26T14:04:38.675663+00:00 app[web.1]: at Object. (/app/build/bundle/programs/server/boot.js:9:13) 2016-09-26T14:04:38.675664+00:00 app[web.1]: at Module._compile (module.js:456:26)

Would this mean anyone using heroku meteor cannot deploy at the moment?

andresjordanze commented 7 years ago

+1

KyrosDigital commented 7 years ago

@humbertocruz changing from meteorhacks/meteord:base to -> abernix/meteord:base, in 3 locations of the start.sh file works, of course after a mupx setup.

I'm using meteor 1.4.1.2 and node 4.6.0

Just wanted to confirm again to others experiencing this issue that this successfully resolved the deploy issue.

KyrosDigital commented 7 years ago

Thanks everyone for helping resolve this, just saved me hours of time!!! cheers

devarthurribeiro commented 7 years ago

In my case I was need to follow these steps: Ubuntu 16.04

  1. nano /usr/local/lib/node_modules/mupx/templates/linux/start.sh
  2. Replace all lines with meteorhacks/meteord to abernix/meteord:base
jirikrepl commented 7 years ago

+1 to official sollution

cwaring commented 7 years ago

Hey folks, I've also published a fork of kadirahq/meteord:base that is updated to node v4.6.1, the security release that meteor moved to in v1.4.1.3.

You're welcome to use it by referencing cwaring/meteord:base - I'll commit to maintain this while upstream is outdated.

yanickrochon commented 7 years ago

Who's maintaining this package anyhow? I see over 400 forks, but the upstream is basically over a year old! With nearly 600 issues and over 60 PR, some of which are about 2 years old!

Will this be fixed? What's the most active / official fork? I need to deploy this app, but cannot wait 6 months for a resolution!