Fossil Forum
Post: [RESOLVED] Get a 400 bad request when updating
Hi everybody,
I use fossil nearly everyday for a long time now to handle my personal data through multiple desktop, and today I met a 400 Bad request while trying to update. The exact message is:
Pull from [remote address]
Bytes Cards Artifacts Deltas
waiting for server...
server says: 400 Bad Request
Pull done, wire bytes sent: 1165 received: 1000 remote: [ip adress]
Autosync failed.
continue in spite of sync failure (y/N)?
I checked the remote adress with a curl in the same terminal and it's ok. I modified the remote adress with and without the user inside (https://user@...) and both config get me a 400 Bad Request. I also checked the repo remote website, everything is fine. I'm not sure it's a proxy problem, I'm still waiting for an answer from the security team but there was no notice of any evolution on this side. Also, does a proxy can generate a 400 Bad Request?
I'm investigating, but any help would be greatly appreciate.
Have a nice day
Maybe run with the --httptrace option. This will cause files named "http-request-N.txt" and "http-reply-N.txt" to be created in your working directory. N will be replaced by consecutive integers for each round-trip. The error is coming from your server. Review the request and reply files for a clue as to why it does not like the request.
Thanks for your answer.
I added the --httptrace option on a fresh fossil clone, here the request:
POST /user/othelarian/repository/[repository] HTTP/1.0
Host: [host address]
User-Agent: Fossil/2.28 (2026-03-11 11:31:46 [52445a27f1])
Content-Type: application/x-fossil-debug
Content-Length: 97
pragma client-version 22800 20260311 113146
clone 3 1
# F62232E14902604F4A5CD50BA50707E42B35B279
The reply looks like this:
HTTP/1.1 400 Bad Request
Server: nginx
Date: Tue, 03 Nov 2026 14:07:40 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 5960
Connection: close
Cache-control: no-cache
Content-Security-Policy: default-src 'self' data:; script-src 'self' 'nonce-0515357d21c71b700193a2803c3edb28677da3a15ca5cb23'; style-src 'self' 'unsafe-inline'; img-src * data:
X-Frame-Options: SAMEORIGIN
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<base href="https://[host address]/user/othelarian/repository/[repository]/xfer">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data:; script-src 'self' 'nonce-0515357d21c71b700193a2803c3edb28677da3a15ca5cb23'; style-src 'self' 'unsafe-inline'; img-src * data:">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>trancode: Bad Request</title>
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="/user/othelarian/repository/[repository]/timeline.rss">
<link rel="stylesheet" href="/user/oth
The command fossil up on the existing repository gave me the same result. I'm still waiting for some answer from the secteam, but it might be an issue with the proxy.
HTTP/1.1 400 Bad Request Server: nginx
Does the body of the response actually give a reason for the Bad Request? Usually a 4xx means that the server (or nginx) thinks that the client (fossil or your browser) made a mistake and will give a reason. This reason would likely give more clues (especially to your secteam).
Are you able to browse the repository?
https://[host address]/user/othelarian/repository/[repository]
I can use the repository from a different network, it works fine, but it isn't the one I'm most frequently connected to. It should retry later on an other network but it seems to be related to this one specifically.
I shared all the content of the http-reply-1.txt, I haven't all the content in the file. I'm looking right now on how to get it all.
I can use the repository from a different network, it works fine, but it isn't the one I'm most frequently connected to.
It's hypothetically possible that this was resolved with the merge of the http1-1-chunked branch. If possible, please try a newer fossil binary. The Aug 1st snapshots currently on are from after that change so should suffice.
It's more than hypothetical, I think its somewhat likely. Note the version 1.1 being referred to here is nginx's, not the client.
The only reason I hesitate is that if the administrator had specifically chosen to drop http 1.0, I'd expect either no reply text at all and just the connection dropped, or 426 "Upgrade Required". But it's entirely up to whoever configured nginx, and they could have chosen 400.
--
Dan Shearer
[email protected] / https://shearer.org
I tried with the last snapshot and I have the exact same result. I retried on a different network, and I've no issue, with the 2.28. Is there a way to force the httptrace to log all the http reply? I started looking in the fossil code, and I wasn't able to find where the limit is defined yet, but I guess there's one.
Is there a way to force the httptrace to log all the http reply?
I'm pretty sure that it already logs the complete HTTP response.
Just a note to mention I experience the same issue with one of my repos on Chiselapp. This repo is working fine from another machine. And another repo on chiselapp works fine from the machine from which I have the problem. Worse: a few hours earlier I could access the repo now spitting 400 from the same machine I'm now having problems with.
It's also a chiselapp repo for me, maybe it's an issue with the server? This is a weird behavior, and it looks more and more like a desktop configuration messing with the http request. I'm still waiting for the secteam to answer my ticket, but there's a big incident since last week, so it will take some time to have any news.
It's also a chiselapp repo for me, maybe it's an issue with the server?
It's certain possible that Chiselapp has some kind of anti-bot technology that is blocking it for some reason. You mentioned that it works fine from one network but not another which could be a telltale sign of such a thing.
These kinds of issues can be difficult to pinpoint.
Edit reply: [RESOLVED] Get a 400 bad request when updating
I am seeing the 400 Bad Request error with Chisel too. I think it has to do with the size of the repository: small repositories can be cloned; larger ones cannot.
The HTTP response body actually contains an "out of memory" error message,
but the --httptrace http-reply-1.txt cuts off before recording it.
You can see it by simulating the HTTP request the fossil client would make:
$ curl -i --data $'pragma client-version 22600 20250516 135248\nclone 3 1\n' -H 'Content-Type: application/x-fossil-debug'
https://chiselapp.com/user/kartoffelbrei/repository/fossil
HTTP/2 400
server: nginx
date: Tue, 10 Nov 2026 07:57:14 GMT
content-type: text/html; charset=utf-8
content-length: 1725
cache-control: no-cache
content-security-policy: default-src 'self' data:; script-src 'self' 'nonce-9e1f5bf4e0dced47179aedbdba84eb96ce6254688b328854'; style-src 'self' 'unsafe-inline'; img-src * data:
x-frame-options: SAMEORIGIN
[...]
<div class="content"><span id="debugMsg"></span>
<p class="generalError">out of memory</p>
</div>
You see the same "out of memory" error in the web browser interface if you try to download a zip or an SQL database from a check-in in the timeline.
https://chiselapp.com/user/kartoffelbrei/repository/fossil/zip/7ad8230273/Fossil-7ad8230273.zip
https://chiselapp.com/user/kartoffelbrei/repository/fossil/sqlar/7ad8230273/Fossil-7ad8230273.sqlar
$ curl -i --data $'pragma client-version 22600 20250516 135248\nclone 3 1\n' -H 'Content-Type: application/x-fossil-debug'
FWIW, it warms my cold, dark heart to see folks write their Fossil sync protocol traffic by hand. It gives me hope for the future :).
It gives me hope for the future
It suggests to me that the protocol was designed well. :-)
That's a thing to try! And indeed my repo is quite big now. I'll try with a new small repo tomorrow.
Is there a way to force the httptrace to log all the http reply?
As it turns out, under some conditions Fossil would truncate the error. If you try the latest on Fossil's trunk you should now get more error output.
At this point, however, the question becomes, why is Chiselapp having "out of memory" errors.
Thanks for the anonymous person the issue is now resolved, it was in fact the size of the repo (around 75Mo). I created a new repo today and I was able to clone it on both network.
Note: chiselapp seems to have a problem with the repository creation, I get an error when I use their interface to generate a new one. I've to reset the repo before being able to make it works. I don't know how to contact chisel administrator, if someone knows how please share.
Thank you everyone for taking the time to help me.
As it seems it isn't a fossil related problem, maybe we can close this thread? I don't know how though
maybe we can close this thread?
We generally only close threads which go completely "off the rails", but those threads are as likely to be shunned as closed. There's just little value compared to the administrative hassle of closing resolved threads. However, in other forums it's common for the OP to edit the top post's subject line and mark it with [RESOLVED] or some such, and you're welcome to do that here.
Hi everybody,
I use fossil nearly everyday for a long time now to handle my personal data through multiple desktop, and today I met a 400 Bad request while trying to update. The exact message is:
Pull from [remote address]
Bytes Cards Artifacts Deltas
waiting for server...
server says: 400 Bad Request
Pull done, wire bytes sent: 1165 received: 1000 remote: [ip adress]
Autosync failed.
continue in spite of sync failure (y/N)?
I checked the remote adress with a curl in the same terminal and it's ok. I modified the remote adress with and without the user inside (https://user@...) and both config get me a 400 Bad Request. I also checked the repo remote website, everything is fine. I'm not sure it's a proxy problem, I'm still waiting for an answer from the security team but there was no notice of any evolution on this side. Also, does a proxy can generate a 400 Bad Request?
I'm investigating, but any help would be greatly appreciate.
Have a nice day
Hmmm wait a second. The issue is not fixed for me.
As I explained previously:
I experience the same issue with one of my repos on Chiselapp. This repo is working fine from another machine. And another repo on chiselapp works fine from the machine from which I have the problem. Worse: a few hours earlier I could access the repo now spitting 400 from the same machine I'm now having problems with.
Being more specific, what I saw when I reported it here:
- I can pull from my repo R1 at Chiselapp fom computer A without a problem. I can't pull from this same repo R1 from computer B (it spits error 400).
- I can, from computer B, pull from another repo R2 from Chiselapp without any problem.
- After having renamed my local copy (both the .fossil file and the directory where it is cloned) of R1, trying to clone repo R1 either machine A or B does not work (spits error 400).
You say:
it was in fact the size of the repo (around 75Mo). I created a new repo today and I was able to clone it on both network
How can I check for the size of a repo?
And, more importantly: are you saying that you had to delete your repo at Chiselapp (how?), created a new one there, and could use the new (empty?) one afterwards? If so, what about all the history/branches/other artifacts of the original repo? Was all this information lost? Such a solution would not be acceptable for me.
I tried something similar:
- I can pull a new repo on both network A and B (I thought it was a network problem first), and even a C (I asked someone to try with his own network)
- I can pull the big old repo (now BOR) from A, but not from B, and my friend cannot do it from C too.
My last commit was made with my machine on network A, so I guess if I try to clone the BOR instead of trying to pull then I'll have a 400 too.
It's just a thought, I have to check the fossil source code to be sure, but my guess is:
- fossil send a first request asking if there's new commits to sync with 2a. server says no, no more commit => repo is ok, get a 200 2b. server says yes => the pull request now ask server for the commits
- server deliver all the fossil db?
It makes sense for me as there's no fossil command to generate patch, like git.
It makes sense for me as there's no fossil command to generate patch, like git.
- patch generates fossil-format patches
- diff -unified generates what the patch command can consume.
I'm investigating, but any help would be greatly appreciate.
Noting that (A) the subject line was (at my suggestion) changed to RESOLVED, (B) later traffic suggests it's not, and (C) you did say any and an LLM falls into that category...
This morning i sat down with one of today's higher-end LLMs and went through this post. It ran dozens of tests, before and after making matches, and found what it believes (and i believe, based on the discussion, symptoms, and proposed resolution) to be the source of your woes.
Summary: it's an error in how the sync layer receives/responds to a very specific constellation which produces an out-of-memory. The sync client would receive an HTML-format message rather than a sync-format message, leading to grief and confusion.
A fix for what i believe to be the root of this problem is now checked in1, which reformulates such responses as sync messages.
It left the following closing notes:
- The server half only helps once the host upgrades. Chiselapp runs 2.26, so its users will keep seeing the 400 until Chiselapp updates. The client half alone does no harm against old servers, which still send HTML the way they do today. Separately, the real fix on Chiselapp's side is the memory or max-download problem from my earlier analysis.
- The client change identifies auth errors by matching message text. There's precedent for that a few lines above (%not authorized to write%), but it would break if those server messages were ever reworded.
Including a couple of follow-up actions for myself:
- Not fixed: non-/xfer fatal errors still return 400. I left that alone because most fossil_fatal() calls really are bad input; it's worth a separate look for out-of-memory and similar server-side faults.
- Not touched: fossil http sends a doubled reply. With a hand-written application/x-fossil-debug request it writes a second complete HTTP reply after the first. Stock 2.29 does the same, so it's not from this patch.
-
My second commit in a few days which has had a purely-decimal prefix out to 10+ spaces. ↩
I'm investigating, but any help would be greatly appreciate.
Noting that (A) the subject line was (at my suggestion) changed to RESOLVED, (B) later traffic suggests it's not, and (C) you did say any and an LLM falls into that category...
This morning i sat down with one of today's higher-end LLMs and went through this post. It ran dozens of tests, before and after making patches, and found what it believes (and i believe, based on the discussion, symptoms, and proposed resolution) to be the source of your woes.
Summary: it's an error in how the sync layer receives/responds to a very specific constellation which produces an out-of-memory. The sync client would receive an HTML-format message rather than a sync-format message, leading to grief and confusion.
A fix for what i believe to be the root of this problem is now checked in1, which reformulates such responses as sync messages.
It left the following closing notes:
- The server half only helps once the host upgrades. Chiselapp runs 2.26, so its users will keep seeing the 400 until Chiselapp updates. The client half alone does no harm against old servers, which still send HTML the way they do today. Separately, the real fix on Chiselapp's side is the memory or max-download problem from my earlier analysis.
- The client change identifies auth errors by matching message text. There's precedent for that a few lines above (%not authorized to write%), but it would break if those server messages were ever reworded.
Including a couple of follow-up actions for myself:
- Not fixed: non-/xfer fatal errors still return 400. I left that alone because most fossil_fatal() calls really are bad input; it's worth a separate look for out-of-memory and similar server-side faults.
- Not touched: fossil http sends a doubled reply. With a hand-written application/x-fossil-debug request it writes a second complete HTTP reply after the first. Stock 2.29 does the same, so it's not from this patch.
-
My second commit in a few days which has had a purely-decimal prefix out to 10+ spaces. ↩
My bad, I thought the command didn't exist, I failed to search correctly.
The question is, is the patch big enough to trigger an out of memory error when we use the pull command?
Also, and if it's truly the issue here, why nobody met this specific error before? Does it mean too few people use fossil with large repositories?
Also, and if it's truly the issue here ...
Disclosure/caveat: i'm not certain that this is the issue. My only certainty is that when a commercial LLM was asked to analyze this forum thread and suggest likely culprits in fossil's source code to explain the behavior, it narrowed down this one as its prime choice.
That fix is definitely a fix for an odd corner case but it might not be the fix for yours. The experiments it devised reproduced your problem before the fix and could not do so after, so my confidence is high that it is the fix for this issue.
why nobody met this specific error before?
If my recollection of the discussion is correct: the failure requires a server which has a sufficiently low max-download setting (see /setup_access) that large outbound traffic could exceed that. Adjustment of that setting is presumably rare but Chisel would be a prime candidate for it. The LLM's experiments used that setting to trigger the fault but it had no insight into Chisel's value so could do no more than speculate as to whether that is the actual cause when syncing with that specific system.
Many thanks for your investigations! Much appreciated!
Here is some more input I can provide:
- The repo R1 I mentioned above actually is https://chiselapp.com/user/fvogel/repository/rtext. This repo works from computer A but not from computer B. It used to work from compoter A in the past.
- The repo R2 I mentioned above actually is https://chiselapp.com/user/fvogel/repository/TclTkDevHelpers. This repo works from both computers A and B.
- Both repos R1 and R2 have the max-download property set to 5000000. I didn't change this setting from the default when I created the repos at Chiselapp.
As a comparison, the max-download setting of R1 and R2 is five times more than what Tcl and Tk have (https://core.tcl-lang.org/tcl and https://core.tcl-lang.org/tk). Tcl and Tk both have max-download set to 1000000.
the failure requires a server which has a sufficiently low max-download setting
Doesn't the above look like the max-download setting is not the culprit?
Regarding the sizes of the repos (from the size of their .fossil file on computer B): Tcl is ~820 Mo, Tk is ~450Mo, R1 is ~4.5Mo and R2 is 0.6Mo. The Tcl and Tk repos therefore are 100 to 200 times larger than R1 and I have no problem with Tcl and Tk from either computer A or computer B. This does not seem (to me) to point to the size of the repo as the source of the problem, as claimed previously by othelarian. But maybe I'm not looking at the right "size of the repo".
I can give you full access to both repo R1 and R2 if you wish to run any experiments.
In any case, it would be handy to test your fix. Who can point us to the Chiselapp administrator so that we can ask for upgrading the fossil version used there? Is it Roy Keene who needs to be pinged for this?
It should be fixed now. The sandbox code was blocking access to mremap(2) so additional memory allocations could sometimes fail.
Can you try it again?
I suspect that there are 2 different issues being tossed around here, maybe even 3 with this new max-download thing.
Has anyone actually observed an "out of memory" error when accessing the same clone from different networks?
Doesn't the above look like the max-download setting is not the culprit?
Based on that it info, yes, but we don't currently have a better lead and i don't currently dare rack up the costs exploring another until we rule it out. Chisel is the only(???) similar failure point we've heard of but it's a black box to us.
Regarding the sizes of the repos
What are the sizes of the largest blobs in each?
I can give you full access to both repo R1 and R2 if you wish to run any experiments.
That's the thing: as we currently see this on only(???) one(???) outdated host, my motivation to prioritize such experimentation is admittedly very low.
Is it Roy Keene who needs to be pinged for this?
Speak of the devil, he just now x-ed'd me in this thread :). (Welcome back, Roy!)
Yes !! I'm no longer seeing the issue.
Many thanks for the help and support, everyone!
What are the sizes of the largest blobs in each?
Using the /bigbloblist page from each repo:
- Tcl : 3079712
- Tk : 35898821
- Repo R1 : 654541
- Repo R2 : 11727
Has anyone actually observed an "out of memory" error when accessing the same clone from different networks?
I didn't. But I could observe the out of memory error in the web browser interface when trying to download a zip (this was also mentioned in post #13 above). This problem also has disappeared since Roy Keene fixed something (see post #27).
You're right, I should be more careful with the certainty of the issue.
I understand the configuration part with the max-download setting, and I may contact chisel admin soon to see if there's something they can do about it. But I still can't grasp why chisel run into this error when trying to sync. I thought it would only download what is strictly needed.
Tomorrow I'll try to analyse the size of my last commit, to get an idea of what seems to be the limit. Also it may point toward a different issue.
EDIT: Roy Keene brought an answer latter on this thread, sorry for this message.
You're right, I should be more careful with the certainty of the issue.
I understand the configuration part with the max-download setting, and I may contact chisel admin soon to see if there's something they can do about it. But I still can't grasp why chisel run into this error when trying to sync. I thought it would only download what is strictly needed.
Tomorrow I'll try to analyse the size of my last commit, to get an idea of what seems to be the limit. Also it may point toward a different issue.
It was my initial issue, I had a "out of memory" error from two different network but not from the third, which was the one with the clone which pushed the last commit, using the fossil clone command. To be exhaustive here:
- day 1 : machine A on network A pushed a commit
- day 2 (morning) : machine B on network B tried to pull the commit and failed. Same result when trying to clone the repo
- day 2 (evening) : machine A pull with success (I should have tried to do a new clone, I don't remember if I did it)
- day 4 : machine C on a network C tried to clone the repo and get the same 400 out of memory
Now it works on network B, I have to try on machine C
I'm investigating, but any help would be greatly appreciate.
Noting that (A) the subject line was (at my suggestion) changed to RESOLVED, (B) later traffic suggests it's not, and (C) you did say any and an LLM falls into that category...
This morning i sat down with one of today's higher-end LLMs and went through this post. It ran dozens of tests, before and after making patches, and found what it believes (and i believe, based on the discussion, symptoms, and proposed resolution) to be the source of your woes.
Summary: it's an error in how the sync layer receives/responds to a very specific constellation which produces an out-of-memory. The sync client would receive an HTML-format message rather than a sync-format message, leading to grief and confusion.
A fix for what i believe to be the root of this problem is now checked in1, which reformulates such responses as sync messages.
It left the following closing notes:
- The server half only helps once the host upgrades. Chiselapp runs 2.26, so its users will keep seeing the 400 until Chiselapp updates. The client half alone does no harm against old servers, which still send HTML the way they do today. Separately, the real fix on Chiselapp's side is the memory or max-download problem from my earlier analysis.
- The client change identifies auth errors by matching message text. There's precedent for that a few lines above (%not authorized to write%), but it would break if those server messages were ever reworded.
Including a couple of follow-up actions for myself:
- Not fixed: non-/xfer fatal errors still return 400. I left that alone because most fossil_fatal() calls really are bad input; it's worth a separate look for out-of-memory and similar server-side faults.
Not touched: fossil http sends a doubled reply. With a hand-written application/x-fossil-debug request it writes a second complete HTTP reply after the first. Stock 2.29 does the same, so it's not from this patch.edit:
-
My second commit in a few days which has had a purely-decimal prefix out to 10+ spaces. ↩