0

I am having a few challenges with a basic app that I have deployed into Heroku.

I attended a Rails workshop yesterday and created the basics of a Twitter-like demo app.

The app works fine on localhost:3000 and is in Github. I deployed to Heroku with no errors in Heroku activities.

However, I get an error when accessing the page: "An error occurred in the application and your page could not be served." That's obviously a standard error - the page is http://chirpy-onlysteveh.herokuapp.com/

I'm trying to access the logs but I can't figure out how to to do that either. I've typed heroku logs in the root folder of the app, but I get 'No app specified'. I added '--app chirpy' to the end of that command hoping to fix the issue.

That gives me '! You do not have access to the app chirpy'. That confuses me - how can I get access to the logs? What are the key points I should investigate?

Marc K
  • 261
  • 3
  • 8
  • 23
OnlySteveH
  • 152
  • 1
  • 2
  • 11

2 Answers2

3

'You do not have access to the ..' surely means something to do with authentication. You need to do heroku login before running heroku logs..

roxxypoxxy
  • 2,973
  • 1
  • 21
  • 28
1

As @roxxypoxxy noted heroku login from the console should be your first step. If that doesn't work, the key points you should investigate are

  1. Generate and add an ssh key to heroku

    • ssh-keygen -t rsa to generate a new key
    • heroku keys:add which should look in the default location to add the key.
    • ssh -v to test the connection.
    • Also optionally do a heroku keys and heroku keys:remove adam@workstation.local that you don't recognize.
  2. heroku login log in to heroku

  3. cd into your heroku app's directory
  4. git remote add heroku git@heroku.com:project.git to your existing heroku app. You shouldn't need to specify your app name once you're in the app's directory.
  5. Retry heroku logs

See also

Community
  • 1
  • 1
Marc K
  • 261
  • 3
  • 8
  • 23
  • Thanks for the tips - really useful! I've tried `heroku login` and made sure I'm signed in. I've also done the `ssh` piece. I still have no access using `heroku logs`, and am getting the same message about `! You do not have access to the app chirpy`. I'm in the folder the app was developed in - is there a different folder to be in to access the heroku server logs? Sorry for the lack of detail; I'm a little out of my depth here! Steve. – OnlySteveH May 15 '15 at 09:22
  • I think heroku pulls the app name from the git repo, but can still be explicitly referenced via --app option. Can you log in to the heroku dashboard online? https://dashboard-next.heroku.com/login – Marc K May 18 '15 at 17:48
  • I can log into the Dashboard, yes. No problems evident in there that I can see. Where would the logs be in there? I've been able to login to the command line too - when I do it runs updates etc. Trying to call `heroku logs` makes it think for quite a while before it returns `! You do not have access ... ` etc. Every other command seems to work fine, though - the web page still displays just an error. – OnlySteveH May 19 '15 at 09:40
  • I tried `heroku apps` to check that my app was listed. It was, but under a different name. That gives me access to the logs. Those mean nothing to me. Is there a way to filter the messages to display errors only? – OnlySteveH May 19 '15 at 10:03
  • Did you create the application on a different computer than the one you are using now? And do you remember if you did a second `heroku create` somewhere in all of this? Your local computer should have the same app name as the heroku app name. – Marc K May 20 '15 at 17:06
  • For filtering errors see http://stackoverflow.com/questions/8607568/can-i-get-heroku-logs-to-return-only-lines-outlining-errors I would also recommend looking into piping, and the unix commands for `head` `tail` and `more` in addition to grep. – Marc K May 20 '15 at 17:08
  • The dashboard should show you a couple of things. Under your username in manage account you can what ssh keys are tied to your heroku account. And under the individual applications there is a tab for access which will tell you who has to individual applications. But it looks like this issue is tied to an app name. – Marc K May 20 '15 at 17:12