I have my site running on a CentOS server, and list view is fine, but when I click on a link to go to a detail view, I now get a Server Error (500).There are no errors in the nginx logs, and I don't know where else to look to debug these. I have just upgraded to django 3, I'm suspecting there is something that I have not corrected for the upgrade, but I don't know what that would be as I am not getting any error messages or stack trace, just Server Error (500). What can I do to find the issue please?
You're probably aware of it, but have you activated Debug mode in the settings.py? So far I always got a very detailed error report on reload when I broke something. Did you change any of the models? I would make sure that your migrations are up to date and you don't ask for any unnamed variables, but you probably already know that.
SOLVED: Whilst I thought I had changed all the
{% load staticfiles %}
to
{% load static %}
I had missed one that was in an extended template that required this tag. Changing that too solved the issue. There was one other issue that was affecting this site and giving a Server Error (500) on another page too, and that is that in django 3.0, it looks like they are enforcing styling also, so I had to change:
{% static 'project_portal/images/icon_add_circle.png'%}
by adding a space between the last ' and the % so this:
{% static 'project_portal/images/icon_add_circle.png' %}
I am usually quite ocd about my styling but I missed this and it's now an issue in Django 3.
Related
I'm using Symfony 4.4.10 and I do have problem with correct error 4xx/5xx handling to get users to my custom html.
On production, when 500 error occurs, I'm getting this kind of screen:
Which is weird, because I followed this tutorial: https://symfony.com/doc/current/controller/error_pages.html
I have my templates overridden (like here), but still above screen occurs. (adding error500.html.twig file isn't changing anything)
When I'm debuging on dev it's ok, I mean, with this custom "_error" route.
What can be the problem here?
404 errors and sometimes work, sometimes not.
Regarding the documentation and your shared code, you are right.
Have you got clear cache dev and production environment ?
php bin/console cache:clear
I'm creating custom error pages for the 404 and 500 error in my Symfony project. I would like to know how to internationalize those pages.
What I mena by thta is that I already know how to use {% trans %} in my twig and how to create the file whit the translated texte. What I
Usally, my urls look like that: kevinduguay.ca/en/..... but in the case of an error page, /en might not be there, but I still need to find in what language I should siplay the page. Maybe the language of the country?
Hope you can help me.
by following this cookbook, you can find current local in error page by:
$request->getLocal();
Although you dont nedd to this, trans() method detect current local
Currently working on Symfony2, I'm trying to make my website work on a server on production environment.
But I get a blank page, it's OK on developpement environment.
Some things I saw :
No log file on app/logs
No specific error on Apache error log
With Firebug, I see a HTTP Error 500 for GET /web/.
Any ideas?
I've seen this happen if you use {{ dump(var) }} and the var has nested arrays. Try removing any dump, and if that does not work, tryign removing any variables you are using in twig to display a static page.
You may want to manually delete the prod cache and install assets again for prod mode. See Symfony Production Checklist for a list of basic steps with D and E covering the cache and assets.
I've configured SonataMediaBundle, added relation to Media in my Entity. Admin for entity works fine until I add this snippet from docs:
twig:
form:
resources:
# other files
- 'SonataMediaBundle:Form:media_widgets.html.twig'
After that all I get is this error:
FatalErrorException: Compile Error: Cannot inherit previously-inherited or override constant MARKER from interface Doctrine\Common\Persistence\Proxy
What I'm doing wrong? How to make sonata_media_type work with its widget template?
googling for somedays for a similar error I came up with the conclusion that is has nothing to do with your code, but is some kind of strange bug in environment, more likely in APC.
Check this post if you are using amazon server: https://forums.aws.amazon.com/message.jspa?messageID=508800
After I did that upgrade the problem solved. I'm still waiting to see if it comes out again, because it was not a permanet error, and after each apache reload/restart it went away for a while...
Other op-caches may solve the problem without loosing performance.
Our website keeps logging a "page not found" error under the Drupal Recent Log Entries, but we do not know where it is coming from. When clicking into the detail of the error, the location is marked as "http:///*", user is "Guest", and severity is "warning". Does anybody have ideas on where we can find out what's causing these errors to log?
Page not found warnings like this can be caused every kind of code that triggers an http request, like loading a .js or .css file or an image. A way to debug this is the quick-and-dirty method described by Lullabot which means that you add a debug_backtrace() at the point where the warning is registered (in your case probably the watchdog() function, see the comment by Randy Fay).
PS. #Arvind: If you're using the Drupal API correctly, there shouldn't be too many drupal_goto calls in your code.
do you have atypo error in your code? check if you have mistakenly commented coz i see /* in the link.
This has to be a local error. I would check for my drupal_goto calls in my code.
this is my guess and i'm no drupal expert. let us know if it helps.
atb!
You might have an issue with your favicon like I did, although I don't recalling it generating errors in my watchdog.
It's what triggered a lot of page not founds on my setup.
Basically, you normally put your favicon in your root. However, some browsers ( I believe IE6 ) , don't check the root for your favicon, but your theme folder.
I just duplicated my favicon in my theme folder, and my problem was solved.
Worth a try.