Cloudflare Pages "Failed due to an internal error"

I have encountered a strange problem using Cloudflare Pages. The last step “Deploying to Cloudflare’s global network” took about half an hour and then “Failed due to an internal error”.

I am using Hugo 0.82.0.

Could it be related to this?:

Do you still see the issue?

I’m encountering the same issue this evening (using Jekyll, not Hugo like MidAutumnMoon).

|00:23:29.440|Deploying your site to Cloudflare’s global network…|
|00:23:34.903|Failed: an internal error occurred|

I don’t believe the issue is caused by changes in my underlying website: the only thing that changed since my last successful build/deploy is I edited a URL in a link.

No, the same error still happens. I think it’s probably not related to that API service issue. Maybe I should sit and wait until this problem got solved. But still thanks for your help!

By the way, Cloudflare Pages returns 500 error instead of showing the 404 page when visit a non-exists page.

I only have /rss.xml /index.xml 301 and a blank line in my _redirects file.

I am getting the same thing.

It seems to happen on the 2nd build.

Also, it doesn’t matter whether its gatsby or hugo.

Both failed.

It is failing on the git clone.

There is no other log, so I have no idea what is causing it.

Are y’all getting this in the log?

10:46:39.976	Initializing build environment. This may take up to a few minutes to complete
10:47:19.816	Success: Finished initializing build environment
10:47:19.816	Cloning repository...
10:47:26.683	Failed: an internal error occurred
1 Like

No, both @MidAutumnMoon and I are getting the same “Failed: an internal error occurred” message later in the process: after the clone and build have completed, during the final “Deploying to Cloudflare’s global network” stage.

Nothing got solved or improved after several days, at least for my account. Maybe we need @MoreHelp :frowning:

You might also try the Discord forum where the Workers devs hang out:

Post the link to this thread so they can read it through.

Thanks a lot! I can’t find the Discord invite link anywhere.

It’s in his post… :slight_smile:

1 Like

I mean, I can’t find the invite link anywhere on Cloudflare’s site or forum before that post. Sorry for my imprecise expression as I’m not a native English speaker.


You certainly had me fooled. You do better than many native English speakers. So you probably meant that you couldn’t find the link. And now you’ve earned a heaping load of sympathy from native-Italian-speaking @matteo.

1 Like

Oh, I always make small mistakes like this one, since there are no such grammars in my language. I do hope I could sense English better in the future. Thanks for such a pleasant chat!


I have a ticket open regarding this (#2130197), one of my pages seems to have a very high chance of “internal error”, I personally suspect its due to the amount of files in my repository (4000), it usually fails at 20 minutes on the “Deploying to Cloudflare’s global network” step.

The documents currently state a 20000 file limit, and with no asset being larger than 25MB

The strange thing is, if I keep on trying to redeploy, it will eventually work, with the final step taking about 16 minutes. So my suggestion would be to double check you’re within the limits, and then just keep re-deploying until it works

But yes, I think there should be a better error message

There is a known bug that is being worked on by the Pages team that will cause this error. I don’t know if this applies to your situation.

It is caused by enabling web analytics, then disabling it.

The workaround is to re-enable web analytics, or to delete site and re-add.


Sadly I’m pretty sure this known bug is not the cause of my error. I haven’t used or enabled Cloudflare Web analytics.

I also have an open ticket regarding this issue (#2138696), I will keep this thread updated if I learn anything from the support ticket.

1 Like

I have successfully deployed my site, and I have a hypothesis as to what was going wrong.

Roughly once per day for the last week, I have been logging into Cloudflare Pages, pulling up the failed build, and clicking “Retry Deployment”. Each time I did so, it failed at the same point:

But today it gave me a different error, this time during the “Building application” step:

|01:23:57.022|Validating asset output directory|
|01:23:57.023|Error: Asset /opt/buildhome/repo/_site/dl/largefile.xlsx is over the 25MB limit. Size: 25410095 bytes|

That file wasn’t new, it had always been in the repository. But previously, Cloudflare Pages just silently omitted it from the website, as I described in this previous Cloudflare Community post: Cloudflare Pages Git LFS: File Size Limit? - #2 by michael94

My working hypothesis is that excessively large files changed from a soft failure (file exclusion) into a hard failure (build crash) during the last week. But the error message was completely vague until a new check was added within the last 24 hours. I have no internal knowledge of what’s happening inside Cloudflare to confirm whether my hypothesis is true. But that’s what happened for me.

Now that I’ve deleted the large file from my repository, I have successfully deployed the latest version of my website.

The Cloudflare Pages surely need more polishing in the future. Actually, I’m just migrating my site back to Workers Site as it’s more feature rich and stable than Pages currently.