question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Heroku Application Error

See original GitHub issue

After clicking the button in README.md I enter a name and click “Create App”. After a minute or two, I get the message “Your app was successfully deployed.” However, if I click the button “View” another page opens with the following error message:

 Application error

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail 

I found the following issues #394 & #364 (the last one is similar however, I have not even entered my credentials yet)… I tried using Safari as well as Firefox and Firefox Developer Edition (in case my browsers were stripping the referee headers) and this link from #394: https://heroku.com/deploy?template=https://github.com/eduardoboucas/staticman/tree/master and I am still getting the Application Error.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
VincentTamcommented, Feb 1, 2021

Remarks about the referenced article:

I tried following the instructions about the additional manual treatment of the RSA PEM file (the removal of the first and the last \n) without success. As last, I decided not to follow its advice and I just pasted the contents of the PEM file into the text area as shown in the above screenshot. Do this for both RSA_PRIVATE_KEY and GITHUB_PRIVATE_KEY. Finally, I’ve managed to get through this problem.

Screenshot from 2021-02-01 11-50-23
Screenshot of my private app: heroku log -a secretman3 --tail

In the middle of this screenshot, you see that there’s an InvalidAsn1Error, which is caused by the incorrect formatting of the Heroku app’s config variable RSA_PRIVATE_KEY. After I corrected that (observe the green line set ... by user ...), the error was gone, and I was able to access the v3/encrypt endpoint.

1reaction
VincentTamcommented, Feb 1, 2021

@Isaac-Tait These two lines in the log explain everything.

Error: Empty key given
at NodeRSA.module.exports.NodeRSA.importKey (/app/node_modules/node-rsa/src/NodeRSA.js:178:19)

You need to set generate your own RSA private key PEM file and paste the content of this file into your Heroku app’s config variable.

staticman-rsa

Successful example: https://github.com/VincentTam/TestStaticmanLab/pull/95

Screenshot from 2021-02-01 11-36-53 Screenshot from 2021-02-01 11-32-49

Reference: https://hajekj.net/2020/04/15/staticman-setup-in-app-service/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I seeing "Application Error"? - Heroku Help
"Application Error" or similar is always caused by your own application code. Routing errors will normally only surface themselves within the logs of...
Read more >
3 tricks for solving the `Heroku Application Error` - Medium
After that, (2) Check your Heroku application's setting you may forget to put `config vars` its looks like the following photos… (3) After...
Read more >
Heroku app successfully deploying, but receiving application ...
Welcome to Stack Overflow. HTTP 500 ("application error") is a generic server-side error message. On its own it doesn't tell us anything useful....
Read more >
Application error when deploying to Heroku - Apollo Community
Hi there I'm getting an error when deploying the server from Heroku (see screenshot) (Odyssey Lift-Off Part 5) The address is ...
Read more >
Deploy to Heroku instructions result in an application error ...
The build succeeds fine with no errors but an application error shows ... heroku[router]: at=error code=H10 desc="App crashed" method=GET ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found