CakePHP unknown exception thrown - cakephp

After successfully testing my app locally, I've pushed it to the remote server for further testing. But there, on each and every page, I get the following fatal error: Fatal error: Exception thrown without a stack frame in Unknown on line 0. What can be the cause of this?

if there was error with the code then there must have been an entry in apache's log. Also, with debug level set, it would definately have given errors unless you have defined your own custom exception handlers. so after all could it be whitespaces ?
It is not mandatory to have closing php tags in php pages unless you have other scripts below. I once struggled with it for days. If it is occuring in every page, you can check it once on the default layout, you could also test by commenting every includes in default layout to see if the problem is caused in some other script common to the application.

Related

Why Do I Get a Blank Page on an Error but other people don't

I am watching this video and when an error occurs he gets an actual error on the page and only a blank white screen when he deploys the site.
I see this a few times. However I only see white screen no matter if I am on local host or on production.
I see he is using chrome on Mac and I am using it on PC. Not sure if that is the difference.
While I can't say definitively, my suspicion is that you aren't using create-react-app to setup your project.
You will only see that error message if you have used CRA to set up your project, as that is a specific error handler that is baked into that project. If you're not using create-react-app, React should log an error to your console instead.
ReactJS smart enough to hide the errors to the users when the app is in production mode.
You will see only a blank page if the app gets crashed but if you inspect the page you will see small detail about the error in the console.
if you running the app in development mode you will see full details about the errors.
for this case cames componentDidCatch method to handle app crash errors, instead of the blank page display a “Something went wrong” message to the user or you can send XHR request to the server with the error info.
Check out this example of declaring and using an error boundary
https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html

Access page secured by htaccess in chromium directly (angularjs error appears)

I experienced an strange error in angularjs when I use .htaccess (AuthType Basic) within chromium.
If I access the page 'in an normal way' the user and password promt get shown from the browser. If I enter them angularjs (and the rest of the page) is working perfectly fine!
But when I access the page with embedded credentials, e.g. like this: http://user:password#domain.com/directory I get the following warnung:
[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass#host/) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details.
which due to its 'just' a warning, it should not cause the issue.
But along this the following error gets shown as well (which stops the page from working):
angular.js:14700 Error: [$controller:ctrlreg] http://errors.angularjs.org/1.6.6/$controller/ctrlreg?p0=myController
at angular.js:88
at angular.js:10973
at da (angular.js:10050)
at q (angular.js:9820)
at f (angular.js:9174)
at f (angular.js:9177)
at angular.js:9039
at angular.js:1954
at m.$eval (angular.js:18423)
at m.$apply (angular.js:18523)
any clue why this error gets show, or better, how to avoid this error? Using non-embedded credentials the error is not appearing and the exact same code is working perfectly fine.
When I use e.g. chrome both approaches are working great as well. The issue just appears using the combination of chromium and embedded credentials.
PS: my chromium is running on raspbian in case this matter.

Static files not loading properly 50% of the time

when i load my site from incognito (when static files are not caches), about 50% of the time some static files which are hosted on app engine are not showing up. one time it can be a CSS file and other times it's JS. in the console i see this error:
Failed to load resource: net::ERR_CONNECTION_RESET
I have no idea why this happens and how to fix it.
Also, when you first go the page, you sometimes see a message saying the page is unavailable, and then immediately the page appears.
How to reproduce:
open this page on incognito (each time): http://alephz.com/
about 5 out of 10 times it should come up without CSS or JS
It might be the DNS prefetching having a problem. Try disabling it by adding <meta http-equiv="x-dns-prefetch-control" content="off"> into your header. Have not seen that being a problem for a while though.
The root problem is a certificate mismatch / expired certificate.
You can see this for yourself in the code here.
Note in particular the use of the very constant you reference in the code on line 44 of the C++ file in above link:
case net::ERR_INSECURE_RESPONSE:
The current version of this file is here. The error status ERR_INSECURE_RESPONSE may not any longer be on line 44 but the error code still exists in the SSL certificate portion of the code.
But as you are requesting the resources over SSL it is likely the certificate is invalid. Either it is self-signed and has not been added to your browser/OS exceptions or it is otherwise invalid.
Try the URI directly in the same browser and inspect the certificate.
This is in no way related to jQuery, JavaScript or CSS directly.

Salesforce: Internal Server Error

I have a visualforce page which is rendering correctly. There is a commandbutton "Save" which executes some DML statement and redirects to some other page. This functionality was working fine earlier. Since yesterday, on click of the "Save" button, i am getting this error :
An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.
Thank you again for your patience and assistance. And thanks for using salesforce.com!
Error ID: 471693248-7806 (-1751278023)
I am not able to find out what is the cause of this error. I even tried commenting out all the code in the method called by Save button. Still, i am getting this error. What can be the cause of this type of error?
This could be caused by something else in your code not related to the Save button. Start by commenting everything out in your controller/extension and save it that way. Then property by property, and method by method un-comment sections; save each time, and review your page. That will give you a better idea where the error occurred. If that doesn't work, call your Salesforce support number.
Since you've already tried commenting out your code to no avail, try changing and re-saving the associated .meta file for your class file.
So if your file ClassName.cls-meta.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>20.0</apiVersion>
<status>Active</status>
</ApexClass>
Try changing the API version number and re-saving:
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>23.0</apiVersion>
<status>Active</status>
</ApexClass>
Also, check to see that your class is listed as both Active and Valid in Name|Setup|Develop|Apex Classes.
Further, your org may have just received its spring upgrade over the weekend and could actually be seeing a genuine Salesforce bug! Log a case and have them troubleshoot it if so.
Good luck

custom cakephp error messages not showing

I have created a custom page for error messages in my web application.
I have created these two files in the views/errors/ directory named 'missing_action.ctp' and 'missing_controller.ctp'.
On server the error message is shown as follows:
and on localhost the error is shown properly like as follows:
I want to show the error messages exactly as that of on localhost but it is not appearing on server. What can be the problem.?
Glad this worked out for you. :)
Is it safe to assume those file were put in the app/ directory? Is the code EXACTLY the same on both installations?
Something to remember: CakePHP might have cached the previous page. Make sure your debug value is set to 1 or 2 in app/config/core.php to disable caching.

Resources