git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Git error message "Server does not allow request for unadvertised object"
@ 2020-05-18  9:20 Yngve N. Pettersen
  2020-05-25 12:27 ` Philippe Blain
  2020-09-06 12:47 ` Yngve N. Pettersen
  0 siblings, 2 replies; 3+ messages in thread
From: Yngve N. Pettersen @ 2020-05-18  9:20 UTC (permalink / raw)
  To: git

Hello all,

A while back I reported an issue to the Windows Git project  
<https://github.com/git-for-windows/git/issues/2218> that I observed in  
Git for Windows 2.21.

The error message "Server does not allow request for unadvertised object"  
is reported when a commit updating a submodule pointer points to a commit  
that does not exist in the repository for that submodule, even if later  
commits in the branch points to a commit that do exist in the submodule  
repo.

This circumstance can easily occur if a developer (e.g)

  * interactively rebases a branch "foo" in the submodule (e.g to integrate  
commits from another branch before a larger rebase)
  * commits the resulting submodule pointer "A" in the branch to the parent  
repo
  * then do further rebasing in the submodule, e.g to move up on top of the  
"bar" branch
  * commits that pointer "B" to the parent repo
  * forgets to squash the history in the parent repo
  * pushes the updated submodule "foo" branch to the online repo. (NOTE:  
"B" is pushed, not "A")
  * pushes the parent module branch to its online repo

When the parent repo is pulled by another developer, or an autobuild  
system, the fetch operation fails with the message "Server does not allow  
request for unadvertised object". A second fetch will complete  
successfully.

IMO this kind of check should only happen if a commit with pointer to a  
missing submodule is actively checked out. At most the above message  
should be a warning, not a fatal error.

For manual fetch operations this is mostly a nuisance, but for  
autobuilders this breaks the update operation, and the entire build  
operation fails. That is unacceptable behavior in an automatic system  
(errors if it breaks the checkout, yes; issues that are not relevant to  
the actual checkout, no).

This issue prevents upgrading past 2.17 (since 2.18 and 2.19 had other  
blocking issues, and 2.20 apparently introduced this issue). I have not  
tested 2.22+ since I have not noticed any changelog messages that seem  
related.

A test case can be found in issue 2218, linked above.

For reference, we do have a server-side git hook that verifies that  
submodule pointers for the production branch is correct and exists in the  
submodule's repo, and also is on branches that follows certain naming  
conventions.


As an aside, I think this kind of error message would be have been better  
suited as either a client-side push check, to prevent pushes of references  
to such missing commits (Smartgit seems to have something like it, but I  
think it only checks for the current branch in the submodule, not all  
submodule reference commits). Alternatively, there could be a check of  
this server-side.


Related to this, but not as problematic, just irritating, and also seen in  
2.17, is a message "warning: Submodule in commit deadbee at path: '(NULL)'  
collides with a submodule named the same. Skipping it." I think it is  
related to recreating a git modules file on a different branch.

-- 
Sincerely,
Yngve N. Pettersen
Vivaldi Technologies AS

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Git error message "Server does not allow request for unadvertised object"
  2020-05-18  9:20 Git error message "Server does not allow request for unadvertised object" Yngve N. Pettersen
@ 2020-05-25 12:27 ` Philippe Blain
  2020-09-06 12:47 ` Yngve N. Pettersen
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Blain @ 2020-05-25 12:27 UTC (permalink / raw)
  To: Yngve N. Pettersen; +Cc: git

Hello Yngve,

> Le 18 mai 2020 à 05:20, Yngve N. Pettersen <yngve@vivaldi.com> a écrit :
> 
> Hello all,
> 
> A while back I reported an issue to the Windows Git project <https://github.com/git-for-windows/git/issues/2218> that I observed in Git for Windows 2.21.
> 
> The error message "Server does not allow request for unadvertised object" is reported when a commit updating a submodule pointer points to a commit that does not exist in the repository for that submodule, even if later commits in the branch points to a commit that do exist in the submodule repo.
> 
> This circumstance can easily occur if a developer (e.g)
> 
> * interactively rebases a branch "foo" in the submodule (e.g to integrate commits from another branch before a larger rebase)
> * commits the resulting submodule pointer "A" in the branch to the parent repo
> * then do further rebasing in the submodule, e.g to move up on top of the "bar" branch
> * commits that pointer "B" to the parent repo
> * forgets to squash the history in the parent repo
> * pushes the updated submodule "foo" branch to the online repo. (NOTE: "B" is pushed, not "A")
> * pushes the parent module branch to its online repo
> 
> When the parent repo is pulled by another developer, or an autobuild system, the fetch operation fails with the message "Server does not allow request for unadvertised object". A second fetch will complete successfully.
> 
> IMO this kind of check should only happen if a commit with pointer to a missing submodule is actively checked out. At most the above message should be a warning, not a fatal error.

I think that's a good idea. 

Another thing that I find confusing with this message is that it can be taken to mean that the server does not support fetching "unadvertised objects", i.e. `uploadpack.allow{Tip,Reachable,Any}SHA1InWant` is false, when in fact the object is simply inexistent...

Philippe.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Git error message "Server does not allow request for unadvertised object"
  2020-05-18  9:20 Git error message "Server does not allow request for unadvertised object" Yngve N. Pettersen
  2020-05-25 12:27 ` Philippe Blain
@ 2020-09-06 12:47 ` Yngve N. Pettersen
  1 sibling, 0 replies; 3+ messages in thread
From: Yngve N. Pettersen @ 2020-09-06 12:47 UTC (permalink / raw)
  To: git

Hello again,

I wondered what is happening about this issue?

This continues to cause problems, especially now that Mac is using Git  
2.21 (without AFAICT any way to revert to 2.17).

The most recent case was last night, after a Work In Progress branch (that  
is, it was not used by any production code) in a submodule was pushed, but  
updates for at least one of the submodules wasn't pushed. Three different  
Mac autobuild jobs broke because of this error and had to be restarted.


On Mon, 18 May 2020 11:20:57 +0200, Yngve N. Pettersen <yngve@vivaldi.com>  
wrote:

> Hello all,
>
> A while back I reported an issue to the Windows Git project  
> <https://github.com/git-for-windows/git/issues/2218> that I observed in  
> Git for Windows 2.21.
>
> The error message "Server does not allow request for unadvertised  
> object" is reported when a commit updating a submodule pointer points to  
> a commit that does not exist in the repository for that submodule, even  
> if later commits in the branch points to a commit that do exist in the  
> submodule repo.
>
> This circumstance can easily occur if a developer (e.g)
>
>   * interactively rebases a branch "foo" in the submodule (e.g to  
> integrate commits from another branch before a larger rebase)
>   * commits the resulting submodule pointer "A" in the branch to the  
> parent repo
>   * then do further rebasing in the submodule, e.g to move up on top of  
> the "bar" branch
>   * commits that pointer "B" to the parent repo
>   * forgets to squash the history in the parent repo
>   * pushes the updated submodule "foo" branch to the online repo. (NOTE:  
> "B" is pushed, not "A")
>   * pushes the parent module branch to its online repo
>
> When the parent repo is pulled by another developer, or an autobuild  
> system, the fetch operation fails with the message "Server does not  
> allow request for unadvertised object". A second fetch will complete  
> successfully.
>
> IMO this kind of check should only happen if a commit with pointer to a  
> missing submodule is actively checked out. At most the above message  
> should be a warning, not a fatal error.
>
> For manual fetch operations this is mostly a nuisance, but for  
> autobuilders this breaks the update operation, and the entire build  
> operation fails. That is unacceptable behavior in an automatic system  
> (errors if it breaks the checkout, yes; issues that are not relevant to  
> the actual checkout, no).
>
> This issue prevents upgrading past 2.17 (since 2.18 and 2.19 had other  
> blocking issues, and 2.20 apparently introduced this issue). I have not  
> tested 2.22+ since I have not noticed any changelog messages that seem  
> related.
>
> A test case can be found in issue 2218, linked above.
>
> For reference, we do have a server-side git hook that verifies that  
> submodule pointers for the production branch is correct and exists in  
> the submodule's repo, and also is on branches that follows certain  
> naming conventions.
>
>
> As an aside, I think this kind of error message would be have been  
> better suited as either a client-side push check, to prevent pushes of  
> references to such missing commits (Smartgit seems to have something  
> like it, but I think it only checks for the current branch in the  
> submodule, not all submodule reference commits). Alternatively, there  
> could be a check of this server-side.
>
>
> Related to this, but not as problematic, just irritating, and also seen  
> in 2.17, is a message "warning: Submodule in commit deadbee at path:  
> '(NULL)' collides with a submodule named the same. Skipping it." I think  
> it is related to recreating a git modules file on a different branch.
>


-- 
Sincerely,
Yngve N. Pettersen
Vivaldi Technologies AS

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-06 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18  9:20 Git error message "Server does not allow request for unadvertised object" Yngve N. Pettersen
2020-05-25 12:27 ` Philippe Blain
2020-09-06 12:47 ` Yngve N. Pettersen

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git