I'm trying to get a custom 500 error page to show on Heroku, running rails 3.2.11
I've followed the steps at:
https://devcenter.heroku.com/articles/error-pages
The process worked fine for the maintenance page, but doesn't seem to work for the error page. I'm positive the S3 URL is correct in Heroku, and when I visit the S3 URL directly I can view the error page just fine (it is set to public).
config.consider_all_requests_local is set to false in production.rb
Any ideas as to why Heroku is not showing it? I just get a blank screen in various browsers (Chrome says it's a 500 error but doesn't render a page).
The heroku's custom error page isn't displayed whenever an exception occurs in your application.
Your application is responsible for displaying this kind of pages.
See using exceptions_app with rails 3.2.
The error page happens when an error occurs with heroku.
The devcenter page about error pages says, about testing your error page :
To test your error page, you can push a bad deploy such as putting a syntax error into a key configuration file, or by creating a path on your app that sleeps for 35 seconds (thereby triggering the error H12 Request Timeout.
Related
I am developing a stack based on NodeJS + Express + SocketIO and I deployed it to Heroku.
The stack involves using concurrency in dyno (I followed Heroku's guide on how to do it) and a Redis adapter for SocketIO.
In addition to SocketIO, a SPA is served with express.static(), responsing to a dynamic path (/app/:name) and API to a path (/api/) and everything works fine, even on Heroku.
The problem arises when this webapp (or just an HTTP client like the one in WebStorm) makes a POST request to the /api/:app/login endpoint and exactly at the point of the express.json middleware which, locally works fine, while on Heroku it randomly takes more than 30 seconds without giving any error on the server and the Heroku router returns H12 error in the logs and returns error 503 to my client.
I noticed it doesn't happen always but almost 3/4 of the times and after i refresh the page or retry the request many times, it works.
Any advice on what could be blocking the middleware?
Thanks
I tried placing logs middleware all over to find the middleware causing the timeout
We are using react-router-dom v6.
We deployed it using aws s3. Also, when there is an error, I set it to go to index.html. The problem is that when moving like "xxx/admin" within React, there is actually only index.html in s3 (xxx/admin is not present), resulting in an error of 404. After that, when an error occurs, it is redirected to index.html and then called properly.
Please tell me how to get rid of this error. It's hard to find because it's my first aws.
i think before react.js bundle imported, xxx/main request first and error redirect to index.html. when redirect to index.html, js imported so react will render the correct pages. if so, how do i fix this problem.. hard problem to me..
or
I think it's SPA, so only one index.html file exists, but when error occurs, aws s3 called something that doesn't exist file. I want to know the fundamental solution rather than using cloudFront.(redirect error 404 -> 200). plz help me.... I'd appreciate it if you could tell me the reason.
Disclaimer: this is a solution using CloudFront.
In case it might help.
I encountered similar problems when I used react-router-dom v5 & v6. I used BrowserRouter. I deployed the React app directly to S3 without using AWS Amplify. I kept encountering 403 error instead of 404, although I rechecked all my permission settings.
This article helped me eventually: https://blog.nicera.in/2020/08/hosting-react-app-on-s3-cloudfront-with-react-router-404-fix/. And your questions raised here had been discussed and answered in details in this article.
Open up your CloudFront distribution for the React App. In the top tabs, click on Error Pages.
Add the configurations for 403 & 404 as below.
I have a website that implemented with .net core 2.1 and angular js.
I published this website on windows server that worked with IIS.
The problem is that, sometimes response of http requests for some files or request (the ajax request that called) is 404 error and sometimes it works correctly and I am sure that file is exists because if the user that faced with error, refresh the page, it will load correctly !
I attached a photos that compare same requests.
After many days I have this problem yet. I enabled IIS logs and attach one of xml log file here.
I am trying to load Google Picker.
I am using this npm package https://www.npmjs.com/package/google-picker
When loading the picker, the auth windows show up, and I can select my Google account.
After auth is done, it tries to open the Google Picker iframe.
It is at this point the iframe fails to load and I get the error
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://docs.google.com') does not match the recipient window's origin
I have searched this issue and many solutions say make sure to add your domain to the authorized JS origins in google console
I have done this! The domain is definitely in the authorized domains for the client. Google sign in works with my app.. but I just can't seem to get the Picker to work.
I have tried both running from localhost and uploading to the server. But I get the same error.
The server I am using is HTTPS. And the iframe URL for picker is HTTPS too. So this should not be a problem.
What else can I try? I am out of options. I am following the API exactly. I have put in all the right keys.
From this SO post answer, it is cited that the issue is with the target origin which is https.
I believe this is an issue with the target origin being https. I
suspect it is because your iFrame url is using http instead of
https. Try changing the url of the file you are trying to embed to
be https.
For instance:
var id = getId(url);
return '//www.youtube.com/embed/' + id + '?showinfo=0&enablejsapi=1&origin=http://localhost:9000';
}
to be:
var id = getId(url);
return 'https://www.youtube.com/embed/' + id + '?showinfo=0&enablejsapi=1&origin=http://localhost:9000';
}
The reason Google Picker was not showing was actually unrelated to the console error.
Even though the console error appeared, the picker still works.
But I thought it was not working because I was using the pickadate library which had css that conflicts with Google Picker.
More info about that issue here: https://github.com/amsul/pickadate.js/issues/619
I am trying to set shopify app proxy url. Although It was working fine before few days back but suddenly I am getting error "502 Bad Gateway".On the store page, it is showing message "There was an error in the third-party application". I also tried to test with different servers and have used both one by one "http" and "https" but I am getting same kind of error in all cases. Please suggest how to set shopify proxy url from shopify developer account. Below are test links:
https://dummy.sdnadev.com/test.html
And I tried to set proxy as :
http://dee1-11.myshopify.com/apps/PG-2C2P
Thanks
I got the solution. It not supporting subdomain. When I use full domain , it works with me.
Bad Gateway error in shopify is often caused when doing large POST or PUT that take longer than 90 seconds.