Tuesday, September 29, 2020

Re: Django Sitemap HTTP Error 500

Thanks kasper. 

I actually did check the logs many times both local and production, nothing is wrong,, I use:
heroku logs --tail -a -myapp on my production environment

All runs smoothly, except when I visit domain.com/sitemap.xml, I got this error. 
Because this is the main reason I requested help. I did my best to search the solution though.

2020-09-29T11:31:08.535970+00:00 app[web.1]: /*some numbers */ - - [29/Sep/2020:18:31:08 +0700] "GET /sitemap.xml HTTP/1.1" 500 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"
2020-09-29T11:31:08.540679+00:00 heroku[router]: at=info method=GET path="/sitemap.xml" host=jawaban.online request_id=(/*some random string*/) fwd="(/*some numbers*/)" dyno=web.1 connect=0ms service=643ms status=500 bytes=286 protocol=http

I also realized that in the log, there are robots crawling my website. Since I have links left to be crawled.

But for newer links in my site, the robot wouldn't find it because this error.


pic above is from my google search console..

this one is from bing webmaster.

Actually I did successfully submitted the sitemap before. But now I got this error suddenly.

Thanks.



On Tue, Sep 29, 2020 at 3:52 PM Kasper Laudrup <laudrup@stacktrace.dk> wrote:
Hi Dum Dum,

On 29/09/2020 10.26, dum dum wrote:
> I'm using django sitemap to generate my sitemap.
>
> In local it works normally, I can visit 127.0.0.1:8000/sitemap.xml
> <http://127.0.0.1:8000/sitemap.xml> and see the data. But in production,
> I got http error 500 (site matching query not exist) when trying to
> access "domain.com/sitemap.xml <http://domain.com/sitemap.xml>". I've
> been following solutions on the internet, and one of those is from this link
>

And as I and others have tried to tell you several times, you can
continue to try random code you find on the internet and hope that the
problem will somehow go away without really knowing why.

That's not a very productive way to write code and just a waste of time.

What you really want to do is to get access to your Django logs where
you most likely have an uncaught exception or something similar pointing
out exactly where the error is and you will most likely be able to fix
it easily.

You do want to be able to access your Django logs in production no
matter what, as this will not be the last time you have an error that
only shows up in production.

Personally I get an email with a full backtrace etc. when an error like
this occurs, which is quite useful in my case, but might not be the
right thing in your case.

If you have problems finding out how to access the logs, then feel free
to ask questions related to that.

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/016ab31a-8b9d-13fd-959f-06bbf4a1930c%40stacktrace.dk.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANV3w%3DYQsnWCMZaz3jTh%3DfDGQF%2BojuGgJ2VKeQvFQjUt41ruzg%40mail.gmail.com.

No comments:

Post a Comment