mozilla / popcorn.webmaker.org

RETIRED
https://blog.mozilla.org/foundation-archive/mozilla-learning/product-update-for-appmaker-and-popcorn-maker/
MIT License
146 stars 116 forks source link

Installing on Heroku #614

Closed ianseyer closed 9 years ago

ianseyer commented 9 years ago

Hi there.

Having issues getting popcorn working properly on Heroku.

It detects the node buildpack, and proceeds to install, but hits an error while installing node-gyp rebuild, which apparently is being executed by node-expat which is something that never actually appears in /node_modules so I am having difficulty tracking it down. The error is too far back in my error logs to retrieve, but was basically a version compatibility error as described roughly here: https://github.com/hipchat/hubot-hipchat/issues/232

I have, however, been able to surpass this by altering my node version to use 0.10 and reverting to v63 of the Heroku Node buildpack (as described in the above issue).

This successfully deploys me a web interface, which can be seen here: https://webmakerpopcorn.herokuapp.com. It can pull media (except youtube, unless I'm misunderstanding something) successfully. However, I cannot seem to login through either a Persona or a username.

In my Heroku error logs I can see: POST /authenticate 500 11ms - 56b and POST /auth/v2/uid-exists 500 4ms - 56b respectively.

How would one go about successfully deploying on Heroku?

ps, my local.js configuration file: https://gist.github.com/ianseyer/c0022ace57cbf458cd9d

secretrobotron commented 9 years ago

@jbuck @Pomax any advice you can give here?

Pomax commented 9 years ago

I suspect this is an old dependency relying on a pre-node v12 node-expat. Rather than downgrading to node 10, it's probably worth checking which node_module has the node-expat dependency and then npm uninstall that --save and renpm install that --save, to see if it gets it to node 12 compliance.

ianseyer commented 9 years ago

Hmm.

@Pomax upon your advice, I tracked down the issue to xml2json. I uninstalled & reinstalled and saved it to package.json (which now reflects the latest version of xml2json). This is on a fresh heroku instance using auto-detected buildpacks.

I also get some build error upon building sqlite, which makes sense because Heroku does not support sqlite (it is in the "option dependencies" section).

Nothing seems to have changed after upgrading xml2json.

Here is the full stack trace: https://gist.github.com/ianseyer/3b5e028c96fd330bcf0b

Just in case, here is the vanilla master package.json for webmaker.popcorn.org: https://github.com/mozilla/popcorn.webmaker.org/blob/master/package.json

EDIT: I have found that popcorn calls for a (very) old version of webmaker-download-locales. That version's xml2json node-expat package.json calls for the node engine to be >=0.8, which is not the same as the master package.json. Could this cause the issue?

EDIT 2: Yes. Changing the version of webmaker-download-locales to >=0.2.5 fixes heroku install error. However, authentication issues are still present.

EDIT 3: Did not realize that I was expected to run my own webmaker auth server. Doing now.

Pomax commented 9 years ago

fun fact: heroku does support sqlite, but because the dyno resets the FS on a sleep/wake cycle, nothing you save is actually persistent (so you indeed need some SQL addon instead if you need persistent data).

If you want to file a PR for that bumped webmaker-download-locales, I'd be happy to merge it in. I think it stopped using xml2json around 0.2 -- should have remember that, since it completely screwed up windows testing at the time so I was actually the person to file the issue on that

ianseyer commented 9 years ago

Done! Will be creating more issues, as I have found quite a few that seem to have simple solutions.

Pomax commented 9 years ago

:+1: