python script giving me a 500 internal server error, any fix?

IslanderMark

Registered Member
Joined
Sep 2, 2020
Messages
88
Reaction score
21
Trying to run a script that auto posts blogs to my site, but the list is a few hundred long.

It gets through about 6 before crashing.

I have implemented time to it to give the code a break for 30 seconds through the loop but that doesn't fix it.

Is there any way I can write the script better so it doesn't make this error appear? Or will this be more of a server issue where I may have to upgrade my server?
 
you get a response when you post to json wp if I'm recalling right, so you should have a response on your python to wait in a 5 second loop till you get that response before loading in the next one. Is that approach one you could take here or similar you think?
 
you get a response when you post to json wp if I'm recalling right, so you should have a response on your python to wait in a 5 second loop till you get that response before loading in the next one. Is that approach one you could take here or similar you think?
currently i implemented a 30 second wait after the post is posted, before beginning the loop again. So this should cover that time. I am not worried about waiting a while to get these posts out so 30 seconds is more than enough for most situations I would assume.

I have it output when it finishes each part of the code, so it typically reaches the categories being applied code then crashes before actually posting.

Starting to think maybe there is too much content within each article and that's affecting the ability for them to be posted? Maybe i need to implement a wait after the content is uploaded just to be safe?
 
Difficult to advise as this could be anything. Catch the exception and provide the stack trace.
 
Trying to run a script that auto posts blogs to my site, but the list is a few hundred long.

It gets through about 6 before crashing.

I have implemented time to it to give the code a break for 30 seconds through the loop but that doesn't fix it.

Is there any way I can write the script better so it doesn't make this error appear? Or will this be more of a server issue where I may have to upgrade my server?
Its a http 500 that is a server error. Not the fault of your script, something to do with your website's api and not your upload script.

Are you using wordpress?
 
Also, are you using python-wordpress-xmlrpc? What version of wordpress are you using?
 
Use try except block and print the exception. And post the exception here so may be any of us can get clear idea about your issue and guide you to solve the issue.
 
It's completely not working or stops working after posting few.? If it can post few in starting than your script is fine I think. You need to check on server side. There are lots of tutorials for solving xmlrpc error 500 just search. This could happen because of wp plugin conflict also. And there some other reasons also. Enable debug/log on php side and check there also you may find something useful.
 
It's completely not working or stops working after posting few.? If it can post few in starting than your script is fine I think. You need to check on server side. There are lots of tutorials for solving xmlrpc error 500 just search. This could happen because of wp plugin conflict also. And there some other reasons also. Enable debug/log on php side and check there also you may find something useful.
Well yea thats why i initially wondered if it was just a server side issue. It has worked for 50ish posts so far, it is currently running and on post 10 of 32, originally it wouldn't really go past 6 or 7 due to the 500 internal error.

I added a few time breaks and think that fixed it up basically.
 
Well yea thats why i initially wondered if it was just a server side issue. It has worked for 50ish posts so far, it is currently running and on post 10 of 32, originally it wouldn't really go past 6 or 7 due to the 500 internal error.

I added a few time breaks and think that fixed it up basically.
May be firewall can also create issues for you here. If your site is usin cloudflare or something that is checking/monitoring activity. So as I said there are so many reasons. you just need to test and try one by one to identify the exact reason in your case.your 1st thing is to start logging on both client and server side so you can see what's actually happening behind the screen.
 
Back
Top