Heroku error logs without heroku command - heroku

How can I check the error logs of Heroku,
without running:
heroku logs
Since I'm using Codeship.io, I can't use 'heroku' commands

There is a free heroku add on, Papertrail.
And this to your heroku app (can be done command line or via the heroku UI)
then on your Resources tab you can click Papertrail.
Helpfull note with Papertaril, you can set up email notifications on string comparisons. This can help for early fault detection.

If you have access to the heroku app you could view the logs from there:
(open the app page then press the dotted more button on the top right then press view logs)
(requires you to keep the logs page open)
logs one
logs two
or set up a webhook
(open the app page then press the dotted more button on the top right then press view webhooks and once the page has loaded click create webhook then set-up your webhook)
(i use it with discord: Ohttps://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
(may not have an error option)
webhooks one
webhooks two
webhooks three
or like gregmcpugh said you could use the add on papertrail. (which i also use)
There is a free heroku add on, Papertrail.
And this to your heroku app (can be done command line or via the heroku UI) then on your Resources tab you can click Papertrail.
Helpful note with Papertrail, you can set up email notifications on string comparisons. This can help for early fault detection.
(no bad thing i can say about this one!)
papertrail one
papertrail two
papertrail three
damn people being before me :P
hope i helped! :D

Related

Shopify App CLI Heroku -- page unresponsive

I created my app with Shopify CLI "shopify create" (Node.js app) and deployed it to Heroku (shopify deploy). I already add my .env variables (scopes ,SHOPIFY_API_KEY, SHOPIFY_SECRET_KEY, host, shop) to my heroku config Vars, and I changed my app url to https://MY-URL.herokuapp.com/ , and the whitelisted redirect urls to https://MY-URL.herokuapp.com/auth/callback
When trying to open the app in my dev store, the interface is shown correctly (see image below)
However, the interface is unresponsive. So e.g. I can not press the button or select the text with mouse. (actually I can not do any mouse actions at all)
I have no idea what could cause this unresponsiveness.
Further info:
If i open https://MY-URL.herokuapp.com/ in browser, Safari says "Safari cant find the server, "https:undefined/admin/oauth/authorize?...",
Chrome says "
This site can’t be reached
Check if there is a typo in undefined.
DNS_PROBE_FINISHED_NXDOMAIN"
I deployed the app a few hours ago (~4 hours) .
Thank you in advance, any help is appreciated.

Google API authentication: Not valid origin for the client

When making an auth request to the Google API (gapi), it's returning false on the checkOrigin.
I have removed any client id's or anything that would link directly to my account and replaced it with a regex indicating what the data is for reference.
Url: https://accounts.google.com/o/oauth2/iframerpc?action=checkOrigin&origin=https%3A%2F%2Flocal.tools&client_id=(\d{21})
My origin url is a local url, which is https://local.tools
Result: {valid: false}
I'm using the example found here without deviation (except for replacing clientid with my 21 digit clientid): https://ga-dev-tools.appspot.com/embed-api/third-party-visualizations/
The items I'm trying to display show up nicely on the demo site, but aren't getting past the Not valid origin for the client error on my local.tools site.
Clear your browser cache. Started getting this error in Chrome and then I created a new client id and was still getting the issue. Opened firefox and it worked, so I cleared the cache on Chrome and it started working.
I received the same console error message when working with this example: https://developers.google.com/analytics/devguides/reporting/embed/v1/getting-started
The documentation says not to overlook two critical steps ("As you go through the instructions, it's important that you not overlook these two critical steps:
Enable the Analytics API [&] Set the correct origins"), but does not clearly state WHERE to set the correct origins.
Since the client ID I had was not working, I created a new project and a new client ID. The new project may not have been necessary, but I'm retaining (and using) it.
Here's what worked:
Create a new project
Add and Enable the Analytics API
Create a new credential - ensure that it is an OAUTH credential (scroll to the bottom of this page for instructions https://developers.google.com/api-client-library/javascript/start/start-js#Setup).
During creation of the credentials, you will see a section called "Restrictions
Enter JavaScript origins, redirect URIs, or both". This is where you can enter your origins.
Save and copy your client ID (and secret).
My script worked after I created the new OAUTH credential, assigned the origin, and used the newly generated client ID following this process.
try clear caches and then hard reload, i had same error but when i tried to run on incognito browser in chrome it worked.
Key Point: Add both http://localhost and http://localhost:port_number to the Authorized JavaScript origins box for local tests or development.
Credentials do not work if API is not enabled. In my case the next steps were needed:
Go to https://console.developers.google.com/apis/library
Enter 'People'
From the result choose 'Google People API'
Click 'Enable'
Creating new oauth credentials worked for me
You probably use Client ID like this: <CLIENT_ID>.apps.google.com
Make sure your client ID is without ".apps.google.com"
For me - I just went here:
https://console.developers.google.com/apis/credentials
Then chose the right project; then choose the credential with the same ID shown in your console error message. When editing the credentials you can add multiple origins to the white list.
After updated Authorized JavaScript origins browser still caching old data, so I need to Empty cache and hard reload then it works
1. Change Authorized origins
2. Open Dev Tool (F12) then right-click into reload button
Clearing the cache on chrome works!
Please find the steps below to clear the cache.
Open dev tools (Right-click on the page and select inspect/ press F12)
Right-click on the chrome reload button while the dev tool is opened. (You will find the option to clear the cache and reload the site)
clearing the cache works for me.
for React developers try to restart the project otherwise it will show the same error again and again.
It was a referrer-policy problem.
This has been such a pain for a long time to me too...
Found the issue, my website instance had a referrer policy set to
no-referrer. After setting it to no-referrer-when-downgrade, the One
Tap prompt showed up as expected.
https://stackoverflow.com/a/63039142/15565029
If you are using Django, SECURE_REFERRER_POLICY is 'same-origin' by default. Change it by adding the below code in your settings file.
# settings.py
SECURE_REFERRER_POLICY = 'no-referrer-when-downgrade'
https://docs.djangoproject.com/en/3.2/ref/settings/#std:setting-SECURE_REFERRER_POLICY
Similar to few answers at above but with screenshots. If you created project for Firebase, may also use the same steps to configure at Google Cloud Platform console.
Select the project at https://console.cloud.google.com/
Navigate to Credentials
Click Edit button for the related OAuth 2.0 Client ID
Add URI into Authorized JavaScript origins
Don't forget to Save
That worked for me after trying for an hour:
On https://console.cloud.google.com/apis/credentials :
Edit Client Outh (mine was: Web Client (Auto Created by Google Service), which was created by my Firebase Web Project)
Enter JavaScript Origin for the Client ID (mine was: localhost:NNNN)
and don't forget to Save.
Try google login for half an hour: didn't work
Enabled Google Analytics as suggested above
Empty Chrome cache and hard reload as suggested above
Try google login for half an hour: didn't work
Sign Out from https://console.cloud.google.com, and sign in again
Empty Chrome cache and hard reload
Now it worked
I don't know which one of the above fixed the problem.
May be it was just a matter of time for cloud.google to
recognize my new JavaScript Origin.
I got the error because of Allow-Control-Allow-Origin: * browser extension.
Trying on a different browser(chrome) worked for me and clearing cache on firefox cleared the issue.
(PS: Not add the hosting URIs to Authorized JavaScript origins in API credentials would give you Error:redirect_uri_mismatch)
I was getting the same error but tried publishing my app and now it shows as below:

Disable Heroku Router Logs

I've written a Heroku app, that's a very simple API. A number of GET requests are made to it with sensitive information amongst their parameters. It would be preferable to have Heroku not log this sensitive information.
Is there any way to have Heroku not log requests or better yet, truncate the path so it contains no parameters?
I don't think there's a way to do it. The usual answer is to POST the sensitive information rather than use GET, but I'm guessing that's not an option for you.
Using heroku logs --source app will only show the logs of you app.
heroku logging
I had the same issue and as I didn't find a solution.
So I'll let you know my workaround for PHP Laravel 6.3 application on Heroku.
Activate Papertrail addon (free with "Wayne" plan)
Show web app output
Filter for "application" (and environment, in my case "staging"
"Save search" -> Replace existing search -> "web app output"
Hope this helps others.
In case anyone is still searching for this. Papertrail now supports Log filters.
Just go to Papertrail > Dashboard > lower right corner > Filter logs.
You can use a regular expression like this:
heroku\/router
and papertrail will ignore all heroku/router logs. This however does not prevent Heroku from emitting those logs altogether, you can still see live heroku/router logs by going to your app's dashboard and clicking "More"> "View Logs.
It can significantly reduce costs though.

Unable to configure Zerigo with Heroku

I have added the Zerigo add-on with heroku. I have followed the steps in the answer here.
Except for the third step. When I attempted to do that, I got an info message that I don't need to do that if I am using the add-on in heroku.
However, if I try to access my custom domain, I get an application error. Executing the command
$ heroku logs
I get the following output (pasted partially):
at=error code=H70 desc="Access to bamboo HTTP endpoint denied" method=GET
I went through this article which says that I need to replace proxy.heroku.com with myapp.herokuapp.com - but I don't understand how I need to do that. I tried adding the snippet as suggested in that stackoverflow answer linked earlier, but in that it points to proxy.herokuapp.com
I got this confirmed when I executed a ping command on my custom domain and got the following output:
64 bytes from proxy.heroku.com : icmp_req=68 ttl=46 time=289 ms
How do I get this working?
Go to https://dashboard.heroku.com/apps
Click on the name of your app
Click on "Zerigo DNS Zerigo Basic" and click "Configure". You should see your custom domain name listed under "Host Records."
Click "Add Snippet". Choose "Heroku" from the dropdown menu.
Click "Add Selected Records".
Go to the CNAME entry under host records and click "Edit". Change data from proxy.heroku.com to YOURAPP.herokuapp.com
I also had to do the following:
Go back to https://dashboard.heroku.com/apps
Click on the name of your app
Click on Settings
Under "Domains" add your custom domains e.g. mydomain.com. I also had to add one starting with "www."
You may have to wait 10-15 min for the settings to propagate.
If the error is ..
Access to bamboo HTTP endpoint denied"
Change your CNAME entry ..
yourdomain.heroku.com -> yourdomain.herokuapp.com
Is it possible is IT working, but you need to flush your DNS cache on your machine? That's a commmon problem, that your local machine has old/bad DNS data cached when you make a DNS change.
Quick test: try looking up the DNS record on your custom domain using
http://www.mydnstools.info/nslookup
If that looks correct, then google how to flush your DNS cache on whatever OS you are using.

heroku no such app

I followed the docs at Heroku and Zerigo to set up a custom domain for MYAPP.heroku.com. When I navigate to myapp.heroku.com, everything works fine. But when I navigate to myapp.com or www.myapp.com, I get the error "Heroku | No such app"
host myapp.heroku.com
myapp.heroku.com is an alias for proxy.heroku.com.
[.....]
looks good, and
host www.myapp.com
www.myapp.com is an alias for proxy.heroku.com.
[.....]
looks good too. But I still get "Heroku | No such app".
totally baffled at this point
The DNS entries look fine - provided you've added www.myapp.com as a custom domain to your application on Heroku then it should work fine. You can check this by viewing the application from the 'My Apps' tab on heroku.com and making sure the custom domain is listed in the domains section as 'www.myapp.com'.
If thats there then I'd log a ticket with support as you're doing everything right.
UPDATE: Heroku Status was just updated with a problem surrounding custom domains, it's likely that this is your problem - https://status.heroku.com/
HEROKU UPDATE: Engineers are still investigating the source of issues regarding custom domains. We have determined that only domains added or updated in the past 48 hours should be affected.
We'll continue to provide more information as it becomes available.

Resources