Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

Troubleshooting

Chloe Lee edited this page Jan 30, 2018 · 6 revisions

Logs

How do I use logs for Rogue Thor and Production?

For Production: SSH into aws-admin and then SSH into rogue. CD to /var/www/rogue/current/storage/logs. There you can access the 5 most recent daily log files.

For Thor: Make sure you have Heroku CLI installed. You can run heroku logs --app rogue-thor to see the most recently logged items. You can also see the logs here on the Heroku website. These log spots store a limited history. To be able to access full log history, check out Logentries. That link defaults to the most recent 20 minutes of logs, but you can also change the time period, search, and see a live tail of the logs.

How do I get access to all of those great log things you linked me to above?

You can request access from @morgan in #devops. Make sure you don't have a working invite buried somewhere in your inbox first though!

Heroku

How do I run artisan commands?

From the command line using Heroku CLI: heroku run php artisan YOUR_COMMAND_HERE --app YOUR_APP_HERE Currently, our only app is rogue-thor.

Gambit

How do I test with Gambit on Thor?

  1. Slack thor to Gambit Staging to get Gambit Thor keywords — look for campaigns that are ‘active’ OR go to https://gambit-admin-staging.herokuapp.com/ (login in LastPass) and you can see campaigns that are active/inactive.
  2. Pick a campaign and text to +1-312-477-0548.

JavaScript Style

What's our ESLint config?

It lives right here!

Do we have a JavaScript Style Guide?

Sure do!

How do I know what these linting rules are?

Search the name of the rule (try no-nested-ternary) into the search box on eslint.org to read more.

Why did we pick these rules?

Airbnb's JavaScript Style Guide sometimes provides some good context for reasons behind linting rules!

Authenticating with Northstar to make API calls v3+

More information about Northstar authentication here.

Setup

  1. In Postman, click on the "Authorization" section.
  2. Choose "OAuth 2.0" from the "TYPE" dropdown menu.
  3. Click on the "Get New Access Token" button.
  4. For your local setup, fill out the form as follows:
  1. Click on "Request Token." This will send you to a popup to log into your account.
  2. If the token isn't populated, click the "Available Tokens" dropdown menu and pick "Northstar QA".
  3. Now you're authorized to make requests!

Troubleshooting

Help! I'm getting an "Error while decoding to JSON" error!

{
    "error": {
        "code": 403,
        "message": "Error while decoding to JSON"
    },
    "debug": {
        "file": "/home/vagrant/DoSomething.org/rogue/vendor/dosomething/gateway/src/Server/Token.php",
        "line": 182
    }
}

If you see this error, it's most likely because your token expired (tokens are only valid for an hour). No worries - just request a new one and you should be good to go!

Help! I'm getting a "file_get_contents(/home/vagrant/Sites/rogue/storage/keys/public.key): failed to open stream: No such file or directory" error!

{
    "error": {
        "code": 500,
        "message": "file_get_contents(/home/vagrant/Sites/rogue/storage/keys/public.key): failed to open stream: No such file or directory"
    },
    "debug": {
        "file": "/home/vagrant/Sites/rogue/vendor/dosomething/gateway/src/Server/Token.php",
        "line": 166
    }
}

This just means you don't have a public key to verify tokens with. Run php artisan gateway:key and then try again!

Help! I'm getting a Access token is invalid or expired. error but I just requested a new token.

A couple things to try:

  • In your Vagrant box, type date to see if your time is off. If so, run vagrant halt and vagrant up again to reset the time.
  • If that doesn't work, copy-paste the token into jwt.io and check it's got the right issuer and expiration