After waiting for 35 minutes Failed: an internal error occurred

Hello and greetings,

I successfully deployed my Python / Flask code from my GitHub repository to use a serverless function and made the necessary configurations in my Cloudflare settings. It seems to be working but when I enter the web address, it actually doesn’t work. After waiting for about 30-35 minutes, it throws an error in a nonsensical way :
Success: Finished cloning repository files
Failed: an internal error occurred

I am confident that there is no error in my code side that would prevent it from functioning. It works flawlessly on my local server, and I can also confirm that it works like a charm on render and replit.
I am unable to see the detailed error code, and it is quite frustrating. I believe this is a bug, and I kindly request assistance from the CF pages developers.

Btw, I also changed my GitHub repository to public, and I encountered the same error again.

Thanks in advance,

What is the build command you are using? Is it python as I can see in one of the screenshots?

Does this command output a static site and exit? Because that’s what Jamstack sites are. You cannot run a never-ending python/Node.js/etc. process.

1 Like

Yes, I am using the build command python to start and again yes via python you can indeed perform never ending process if set it up correctly the logic of Flask websites actually functions in that way.

If you would like to see the Flask websites that I currently have running as serverless functions and that I couldn’t succeed here due to technical problems, here are the links:

Cloudflare Pages is for fullstack content (HTML, CSS, JS, images and other such files). It will not run a webserver such as Express, Koa, Flask or the likes. If you’re using those to serve static content then you can just remove that part and use Pages!

If you’re doing more dynamic content you can use Functions (Functions · Cloudflare Pages docs). It will run code on request (so still not a webserver in the conventional sense). This would allow for more dynamic content though especially with KV (Key Value storage) and Durable Objects (transactional data storage). Functions are natively integrated with Pages so are super easy to get up and running along your website.
Otherwise, a good old VPS or dedicated server from one of the many hosts out there is for you.


Well good to know that!
Due to the financial situation in Turkey, I won’t be able to sustain the costs of a VPS or dedicated server + as well as domain expenses for my project in the longterm run. That’s why I am looking alternative solutions lol
The ObsPy library is specifically developed for only python and unfortunately there is no alternative available. It is the only library in the world that can visualize the seismic activity in my project. So there is no possibility of removing it.

Thanks anyway