Forums

Reloading Problem

The reload button loads but eventually times out...none of my apps are presently working because of this problem. I also ran a scheduled reload which appears to have had no problem in its log...but the reload never seems to have been completed.

My error log is also empty.

I've been trying everything I can think of but do not know what is going wrong, my code was just working. Could there be a problem on the PA server? Has anyone else experienced this?

I'm getting the message "There was a problem. If this keeps happening, please send us feedback."

Thank you so much...sorry I do not have more detail.

The same problem is still occuring however the message changed. It now says...

"Your webapp took a long time to reload. It probably reloaded, but we were unable to check it."

I do not think it reloaded as my apps are still not working.

Hi there,

I took a look at your webapp and it seems that it was stuck in some weird state- the normal reload webapp code wasn't able to kill it (and hence wasn't able to start a new process).

I tried some other methods of killing it and eventually killed it by sending a SIGTERM (force kill). So you should be good to go now.

Do you know if you could have been doing anything beforehand that could have caused this? (for example, I think something similar happens if someone uses a flask app.run without putting it inside a __main__ block.

Hey Conrad,

I can see it is working again now, thanks!

I am new to programming in generally...but can say I did NOT include the __main__ in the flask app because python anywhere recommended not having app.run in it.

Now looking here https://help.pythonanywhere.com/pages/Flask/ I can see that the __main__ isn't bad just the app.run being outside of it. I will change this.

Alternatively I also was running a program continuously for the first time(could this be a cause?)

Is there anyway I can manually use the SIGTERM force kill should I run into the same problem rather than reaching out to PA staff?

Thanks so much!

[edited by admin: formatting]

Weird- usually processes do get killed automatically (so it shouldn't be a problem). For consoles and scheduled tasks, you can go to the bottom of the page and hit the fetch processes list button to view and kill running processes. We don't have anything like that for webapps right now (although that has rarely been a problem so far).

Whatever you did, I am not sure it worked. The problem is persisting. I also killed all consoles/fetched all proccess and killed them...

Could this be caused by a third party app that has a continuous connection to another server sending data? What about a flask app with an error?

You're right. Did you make any changes to your code? And are you sure you are not doing anything that is running forever and blocking? I've manually killed your webapp again, and hitting your webapp just at '/' does not seem to work anymore (it worked just 5 hours ago, and returned a this url not found/configured type message).

The only change I made to my code was to include the if name == 'main': app.run()

I'm not sure what could be running forever and blocking it as I killed all processes. I have a third party web app interacting with it that has code for THEIR server to "wait forever." this line of code keeps the script running so python anywehere will run its own script when it is called by the other server...

This code is meant to continue running...is it causing the problem? It has NOT been running during this problem

It was also running fine earlier in the day yesterday

I've had a look at the server in question and it looks like it's doing everything that it should be doing to run your app. The lockup appears to be in your code. It's either in the root url (/) request handling or (more likely, in my opinion) somewhere at import time.

Are there any more hints you could give me to find the source of the problem?

I have tried rewritting my flask app. I do not think other scripts could have an impact as they are not running, is that incorrect?

Is there a way to identify the file/line with the problem??

Thanks so much...

Other scripts running probably won't have an effect on your web app.

Simplify everything. Start with trying to work out whether it's in your root view or at import time by reducing your root view to just return some text. If it's in the root view, that will work. Then you can re-add bits of the root view back in until you see the problem and work out from there what is causing it. If it isn't in your root view, then you need to strip your app down to just a root view that just returns some text, then start re-adding bits back until it fails again. Use that information to work out where the problem is.

Hey Glenn,

This is a bit odd as I have not changed anything...and now it is working!

Have you been acting behind the scenes? From its recent success without any changes to the code...I have to wonder if the problem was in my code?

I am concerned as I do not seem to know what caused/stopped this error and I cannot have it go down this long again...

Thanks for your help

Hey Glenn,

I may have found whats going on...

the error seems to be caused by a script that I run that asks to keep a connection open forever with another server. Even though i killed this script in the console...I dont seem to be able to undo the command.

The intention for keeping that connection open is so if that server sends data to my PA server, it can immediately act on it rather than frequently checking for the data to have come in. I am new to programming and imagine there may be better solutions but the third party recommended keeping the connection open.

I believe this is the problem because as soon as it started working again, immediately when I ran that script the problem persisted.

The only thing I do not know is how this problem was fixed in the first place. My guess? I can see that my CPU allowance reset to zero and the allowance rebooted so to speak.

is there anyway you can kill this with the SIGTERM (force kill) conrad tried before? Or is there a way I can run SIGTERM, in case this is NOT the problem(as in another line of the same script)? It seemed to work at that time. I'll make sure NOT to use that command again and contact the third party and search for a better solution for my PA scripts respond immediately to the other server(if you have a recommendation I am open to it)

Thanks.

You can kill processes yourself from the Consoles page or the Schedule page (depending on how you started them) by clicking the "Fetch process list" and clicking the kill button by the process.

I am having a hard time working out how running a script can be affecting your web app, but I guess you'll have a better idea of what the two are doing.

hey, I couldn't reload my web app I get this message "There was a problem. See this help page for some debugging tips. If it keeps happening, please send us feedback. ". The reload button loads but eventually times out and my web page is not working. Please give a solution as soon as possible.

Thanks

hmm- it seems like your website works fine- did you manage to fix your problem?

Hi! My site is getting stuck in loading every time. After "Reload" from "Web", it fixes but just for few minutes. Then this thing again starts.

@yts what do you see in the error/server logs?

Error Log:

2021-06-01 20:59:13,500: OSError: write error 2021-06-01 21:01:13,598: OSError: write error 2021-06-01 21:03:13,601: OSError: write error 2021-06-01 21:04:15,292: OSError: write error 2021-06-01 21:05:15,557: OSError: write error 2021-06-01 21:06:15,684: OSError: write error 2021-06-01 21:07:16,389: OSError: write error 2021-06-01 21:08:16,658: OSError: write error 2021-06-01 21:08:17,365: OSError: write error 2021-06-01 21:08:18,022: OSError: write error 2021-06-01 21:08:18,681: OSError: write error 2021-06-01 21:08:19,555: OSError: write error 2021-06-01 21:08:20,398: OSError: write error 2021-06-01 21:08:21,085: OSError: write error 2021-06-01 21:08:22,492: OSError: write error 2021-06-01 21:08:23,556: OSError: write error 2021-06-01 21:08:24,711: OSError: write error 2021-06-01 21:08:26,050: OSError: write error 2021-06-01 21:08:27,399: OSError: write error 2021-06-01 21:08:28,565: OSError: write error 2021-06-01 21:08:32,316: OSError: write error 2021-06-01 21:08:59,467: OSError: write error 2021-06-01 21:29:54,588: OSError: write error 2021-06-01 21:29:55,901: OSError: write error 2021-06-01 21:29:57,251: OSError: write error 2021-06-01 21:31:09,562: OSError: write error 2021-06-01 21:32:09,779: OSError: write error 2021-06-01 21:33:09,501: OSError: write error 2021-06-01 21:34:09,608: OSError: write error 2021-06-01 21:35:09,496: OSError: write error 2021-06-01 21:36:09,492: OSError: write error 2021-06-01 21:37:09,680: OSError: write error 2021-06-01 21:38:09,598: OSError: write error 2021-06-01 21:39:09,497: OSError: write error 2021-06-01 21:39:10,035: OSError: write error 2021-06-01 21:39:11,048: OSError: write error

Server Log:

2021-06-01 21:32:09 Tue Jun 1 21:32:09 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=hopes_legacy_2021&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:32:09 Tue Jun 1 21:32:09 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=hopes_legacy_2021&type=medium-cover (10.0.0.93) 2021-06-01 21:33:09 Tue Jun 1 21:33:09 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=scare_us_2021&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:33:09 Tue Jun 1 21:33:09 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=scare_us_2021&type=medium-cover (10.0.0.93) 2021-06-01 21:34:09 Tue Jun 1 21:34:09 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=gap_year_2021&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:34:09 Tue Jun 1 21:34:09 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=gap_year_2021&type=medium-cover (10.0.0.93) 2021-06-01 21:35:09 Tue Jun 1 21:35:09 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=after_masks_2021&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:35:09 Tue Jun 1 21:35:09 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=after_masks_2021&type=medium-cover (10.0.0.93) 2021-06-01 21:36:09 Tue Jun 1 21:36:09 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=the_dig_2021&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:36:09 Tue Jun 1 21:36:09 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=the_dig_2021&type=medium-cover (10.0.0.93) 2021-06-01 21:37:09 Tue Jun 1 21:37:09 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=american_dream_2021&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:37:09 Tue Jun 1 21:37:09 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=american_dream_2021&type=medium-cover (10.0.0.93) 2021-06-01 21:38:09 Tue Jun 1 21:38:09 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=loaded_monday_2021&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:38:09 Tue Jun 1 21:38:09 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=loaded_monday_2021&type=medium-cover (10.0.0.93) 2021-06-01 21:39:09 Tue Jun 1 21:39:09 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=revealed_the_hunt_for_bin_laden_2021&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:39:09 Tue Jun 1 21:39:09 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=revealed_the_hunt_for_bin_laden_2021&type=medium-cover (10.0.0.93) 2021-06-01 21:39:10 Tue Jun 1 21:39:10 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /assets/images/movies?name=emperor_2012&type=medium-cover (ip 10.0.0.93) !!! 2021-06-01 21:39:10 Tue Jun 1 21:39:10 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /assets/images/movies?name=emperor_2012&type=medium-cover (10.0.0.93) 2021-06-01 21:39:11 Tue Jun 1 21:39:11 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /moviedetails?movie_id=24852& (ip 10.0.0.93) !!! 2021-06-01 21:39:11 Tue Jun 1 21:39:11 2021 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /moviedetails?movie_id=24852& (10.0.0.93)

can you give us a brief overview of what your website does when it is reloaded? eg: does it hit any external websites, does it do file i/o, etc

hi i am unable to reload my webapp please can you help

What do you mean by that? What happens when you reload it?