Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku Deployment yields several 403 errors #1656

Closed
TaylorAckley opened this issue Jun 9, 2017 · 8 comments
Closed

Heroku Deployment yields several 403 errors #1656

TaylorAckley opened this issue Jun 9, 2017 · 8 comments

Comments

@TaylorAckley
Copy link

TaylorAckley commented Jun 9, 2017

I have deploy adapt to a heroku environment, but when the page loads I get 403 Forbidden on several assets.

Has anyone also had this issue? Steps, Console output and config.json is below.

Steps:

  1. Cloned adapt framework
  2. Ran grunt build
  3. ran install script
  4. Application works on local machine
  5. Change application.js to accept process.env.PORT (since Heroku assigns ports dynamically)
  6. Change config.json (below)
  7. Deploy to Heroku
  8. I open up the app (SSL) and get the loading symbol.
  9. The logs say the server is running and the DB is connected, but I get a mess of 403 errors

Console Output

adapt.css Failed to load resource: the server responded with a status of 403 (Forbidden)
origin.js Failed to load resource: the server responded with a status of 403 (Forbidden)
require.js:8 Uncaught Error: Script error for: adaptbuilder/js/origin.js?20170609231936778
http://requirejs.org/docs/errors.html#scripterror
    at A (require.js:8)
    at HTMLScriptElement.onScriptError (require.js:29)
A @ require.js:8
onScriptError @ require.js:29
adapt.css Failed to load resource: the server responded with a status of 403 (Forbidden)

config.json

{
  "root": "",
  "serverName": "<heroku_app_name>.herokuapp.com",
  "dbHost": "<db_host>",
  "dbName": "<db_name>",
  "dbPort": 55411,
  "dataRoot": "data",
  "sessionSecret": "your-session-secret",
  "useffmpeg": true,
  "smtpService": "none",
  "smtpUsername": "",
  "smtpPassword": "",
  "fromAddress": "",
  "outputPlugin": "adapt",
  "dbType": "mongoose",
  "auth": "local",
  "masterTenantName": "master",
  "masterTenantID": "593b088abe2c5620056e6ef2",
  "isProduction": true
}
@frostme
Copy link

frostme commented Aug 1, 2017

+1 @TaylorAckley I am getting the same issue, did you find anything out?

@TaylorAckley
Copy link
Author

@frostme Negative. Tried a few other things then gave up. Switched to a AWS Linux MI instance.

@frostme
Copy link

frostme commented Aug 1, 2017

@TaylorAckley ah, AWS machine works just as well. i just figured out that, at least for me, it was the fact that the grunt build:prod process didn't actually finish. So files like adapt.css didn't actually exist. So because of that adapt was using the regular router, and checked for authenticaiton (hence the 403). I just went on to the heroku app bash, and ran grunt build:prod, and then restarted the app and its working.

@TaylorAckley
Copy link
Author

TaylorAckley commented Aug 1, 2017 via email

@frostme
Copy link

frostme commented Aug 1, 2017

I know right! why didn't anyone tell me this! lol heroku run bash

@TaylorAckley
Copy link
Author

TaylorAckley commented Aug 1, 2017 via email

@taylortom
Copy link
Member

@TaylorAckley, @frostme I got this working over a year ago, but can't remember what was required (various core JS changes). Would be interested to hear how you get on, as I'm keen to get this working more smoothly for folks.

@taylortom
Copy link
Member

Closing as we don't support Heroku depoyment as the Adapt project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants