-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random NotFoundHttpException with ajax requests #32303
Comments
Hi there, Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels: However, this issue will not be locked and everyone is still free to discuss solutions to your problem! Thanks. |
Problem is solved. I added the I still wonder why calling the env() in the routes seemed to work fine for regular requests and only gives problems so randomly when handling ajax requests. If anyone knows, I would love to hear more about this part! |
Well, the problem isn't solved 100%. The problem still exists but its way less frequently. And now I get new errors like "No application encryption key has been specified" And "Access denied for user 'forge'@'localhost'" while my .env is fine and in place. These errors got me searching again and I found these threads: |
Please help me with what are you using to serve your application Most probably you are using artisan serve? |
During that time I was serving the application through apache (xampp for windows) set up with a virtualhost pointing to my application. |
Have you found a solution for this problem? I am having it too. |
Description:
Upon ajax requests you would get a NotFoundHttpException at random. This happens more when the routes are not being cached, and still exist in lesser amount when the routes are cached.
I initially found out about this while implementing serverside datatables. The package https://github.com/yajra/laravel-datatables has a known bug while running php artisan serve. So I tried to reproduce it with a clean jQuery ajax request to make sure its not just this package but in Laravel itself.
Already tried composer update, dump-autoload, clearing cache. None worked.
Steps To Reproduce:
web.php
Admin/ProfileController.php
Scripts inside admin.pages.profiles.index.blade.php
Complete message on failure:
Going to the admin.profiles.index page loads the view as expected. Triggers the ajax requests. One request to populate the datatable. And one request for this testing purpose. Monitoring the Chrome network tab shows http status code 404 at random for these request with the error NotFoundHttpException in the response. Without caching the routes it fails 50% of the time. With caching routes it fails like 5% of the time. When I don't get the 404, everything goes through and I get the expected response populating the table. This goes for both ajax request.
The text was updated successfully, but these errors were encountered: