{"thread":{"id":"53493","subject":"Git error message \"Server does not allow request for unadvertised object\"","startedAt":"2020-05-18T09:29:26Z","lastAt":"2021-09-01T12:13:48Z","messageCount":4,"participants":["Yngve N. Pettersen","Philippe Blain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"398040","messageId":"op.0ks2w7r1pvqxoc@rowan.vivaldi","threadId":"53493","inReplyTo":null,"subject":"Git error message \"Server does not allow request for unadvertised object\"","fromName":"Yngve N. Pettersen","fromEmail":"yngve@vivaldi.com","sentAt":"2020-05-18T09:20:57Z","receivedAt":"2020-05-18T09:29:26Z","isPatch":false,"sender":{"key":"yngve@vivaldi.com","avatar":null},"body":"Hello all,\n\nA while back I reported an issue to the Windows Git project  \n<https://github.com/git-for-windows/git/issues/2218> that I observed in  \nGit for Windows 2.21.\n\nThe error message \"Server does not allow request for unadvertised object\"  \nis reported when a commit updating a submodule pointer points to a commit  \nthat does not exist in the repository for that submodule, even if later  \ncommits in the branch points to a commit that do exist in the submodule  \nrepo.\n\nThis circumstance can easily occur if a developer (e.g)\n\n  * interactively rebases a branch \"foo\" in the submodule (e.g to integrate  \ncommits from another branch before a larger rebase)\n  * commits the resulting submodule pointer \"A\" in the branch to the parent  \nrepo\n  * then do further rebasing in the submodule, e.g to move up on top of the  \n\"bar\" branch\n  * commits that pointer \"B\" to the parent repo\n  * forgets to squash the history in the parent repo\n  * pushes the updated submodule \"foo\" branch to the online repo. (NOTE:  \n\"B\" is pushed, not \"A\")\n  * pushes the parent module branch to its online repo\n\nWhen the parent repo is pulled by another developer, or an autobuild  \nsystem, the fetch operation fails with the message \"Server does not allow  \nrequest for unadvertised object\". A second fetch will complete  \nsuccessfully.\n\nIMO this kind of check should only happen if a commit with pointer to a  \nmissing submodule is actively checked out. At most the above message  \nshould be a warning, not a fatal error.\n\nFor manual fetch operations this is mostly a nuisance, but for  \nautobuilders this breaks the update operation, and the entire build  \noperation fails. That is unacceptable behavior in an automatic system  \n(errors if it breaks the checkout, yes; issues that are not relevant to  \nthe actual checkout, no).\n\nThis issue prevents upgrading past 2.17 (since 2.18 and 2.19 had other  \nblocking issues, and 2.20 apparently introduced this issue). I have not  \ntested 2.22+ since I have not noticed any changelog messages that seem  \nrelated.\n\nA test case can be found in issue 2218, linked above.\n\nFor reference, we do have a server-side git hook that verifies that  \nsubmodule pointers for the production branch is correct and exists in the  \nsubmodule's repo, and also is on branches that follows certain naming  \nconventions.\n\n\nAs an aside, I think this kind of error message would be have been better  \nsuited as either a client-side push check, to prevent pushes of references  \nto such missing commits (Smartgit seems to have something like it, but I  \nthink it only checks for the current branch in the submodule, not all  \nsubmodule reference commits). Alternatively, there could be a check of  \nthis server-side.\n\n\nRelated to this, but not as problematic, just irritating, and also seen in  \n2.17, is a message \"warning: Submodule in commit deadbee at path: '(NULL)'  \ncollides with a submodule named the same. Skipping it.\" I think it is  \nrelated to recreating a git modules file on a different branch.\n\n-- \nSincerely,\nYngve N. Pettersen\nVivaldi Technologies AS\n"},{"id":"398484","messageId":"3EE73235-F418-465D-9313-912F7B5AC8F9@gmail.com","threadId":"53493","inReplyTo":"op.0ks2w7r1pvqxoc@rowan.vivaldi","subject":"Re: Git error message \"Server does not allow request for unadvertised object\"","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2020-05-25T12:27:28Z","receivedAt":"2020-05-25T12:27:35Z","isPatch":false,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hello Yngve,\n\n> Le 18 mai 2020 à 05:20, Yngve N. Pettersen <yngve@vivaldi.com> a écrit :\n> \n> Hello all,\n> \n> 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.\n> \n> 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.\n> \n> This circumstance can easily occur if a developer (e.g)\n> \n> * interactively rebases a branch \"foo\" in the submodule (e.g to integrate commits from another branch before a larger rebase)\n> * commits the resulting submodule pointer \"A\" in the branch to the parent repo\n> * then do further rebasing in the submodule, e.g to move up on top of the \"bar\" branch\n> * commits that pointer \"B\" to the parent repo\n> * forgets to squash the history in the parent repo\n> * pushes the updated submodule \"foo\" branch to the online repo. (NOTE: \"B\" is pushed, not \"A\")\n> * pushes the parent module branch to its online repo\n> \n> 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.\n> \n> 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.\n\nI think that's a good idea. \n\nAnother 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...\n\nPhilippe."},{"id":"405090","messageId":"op.0qiwhxykpvqxoc@rowan.vivaldi","threadId":"53493","inReplyTo":"op.0ks2w7r1pvqxoc@rowan.vivaldi","subject":"Re: Git error message \"Server does not allow request for unadvertised object\"","fromName":"Yngve N. Pettersen","fromEmail":"yngve@vivaldi.com","sentAt":"2020-09-06T12:47:47Z","receivedAt":"2020-09-06T12:55:57Z","isPatch":false,"sender":{"key":"yngve@vivaldi.com","avatar":null},"body":"Hello again,\n\nI wondered what is happening about this issue?\n\nThis continues to cause problems, especially now that Mac is using Git  \n2.21 (without AFAICT any way to revert to 2.17).\n\nThe most recent case was last night, after a Work In Progress branch (that  \nis, it was not used by any production code) in a submodule was pushed, but  \nupdates for at least one of the submodules wasn't pushed. Three different  \nMac autobuild jobs broke because of this error and had to be restarted.\n\n\nOn Mon, 18 May 2020 11:20:57 +0200, Yngve N. Pettersen <yngve@vivaldi.com>  \nwrote:\n\n> Hello all,\n>\n> A while back I reported an issue to the Windows Git project  \n> <https://github.com/git-for-windows/git/issues/2218> that I observed in  \n> Git for Windows 2.21.\n>\n> The error message \"Server does not allow request for unadvertised  \n> object\" is reported when a commit updating a submodule pointer points to  \n> a commit that does not exist in the repository for that submodule, even  \n> if later commits in the branch points to a commit that do exist in the  \n> submodule repo.\n>\n> This circumstance can easily occur if a developer (e.g)\n>\n>   * interactively rebases a branch \"foo\" in the submodule (e.g to  \n> integrate commits from another branch before a larger rebase)\n>   * commits the resulting submodule pointer \"A\" in the branch to the  \n> parent repo\n>   * then do further rebasing in the submodule, e.g to move up on top of  \n> the \"bar\" branch\n>   * commits that pointer \"B\" to the parent repo\n>   * forgets to squash the history in the parent repo\n>   * pushes the updated submodule \"foo\" branch to the online repo. (NOTE:  \n> \"B\" is pushed, not \"A\")\n>   * pushes the parent module branch to its online repo\n>\n> When the parent repo is pulled by another developer, or an autobuild  \n> system, the fetch operation fails with the message \"Server does not  \n> allow request for unadvertised object\". A second fetch will complete  \n> successfully.\n>\n> IMO this kind of check should only happen if a commit with pointer to a  \n> missing submodule is actively checked out. At most the above message  \n> should be a warning, not a fatal error.\n>\n> For manual fetch operations this is mostly a nuisance, but for  \n> autobuilders this breaks the update operation, and the entire build  \n> operation fails. That is unacceptable behavior in an automatic system  \n> (errors if it breaks the checkout, yes; issues that are not relevant to  \n> the actual checkout, no).\n>\n> This issue prevents upgrading past 2.17 (since 2.18 and 2.19 had other  \n> blocking issues, and 2.20 apparently introduced this issue). I have not  \n> tested 2.22+ since I have not noticed any changelog messages that seem  \n> related.\n>\n> A test case can be found in issue 2218, linked above.\n>\n> For reference, we do have a server-side git hook that verifies that  \n> submodule pointers for the production branch is correct and exists in  \n> the submodule's repo, and also is on branches that follows certain  \n> naming conventions.\n>\n>\n> As an aside, I think this kind of error message would be have been  \n> better suited as either a client-side push check, to prevent pushes of  \n> references to such missing commits (Smartgit seems to have something  \n> like it, but I think it only checks for the current branch in the  \n> submodule, not all submodule reference commits). Alternatively, there  \n> could be a check of this server-side.\n>\n>\n> Related to this, but not as problematic, just irritating, and also seen  \n> in 2.17, is a message \"warning: Submodule in commit deadbee at path:  \n> '(NULL)' collides with a submodule named the same. Skipping it.\" I think  \n> it is related to recreating a git modules file on a different branch.\n>\n\n\n-- \nSincerely,\nYngve N. Pettersen\nVivaldi Technologies AS\n"},{"id":"434425","messageId":"1630496467881.2030439049.4247253551@vivaldi.com","threadId":"53493","inReplyTo":"op.0qiwhxykpvqxoc@rowan.vivaldi","subject":"Re: Git error message \"Server does not allow request for unadvertised object\"","fromName":"Yngve N. Pettersen","fromEmail":"yngve@vivaldi.com","sentAt":"2021-09-01T12:04:56Z","receivedAt":"2021-09-01T12:13:48Z","isPatch":false,"sender":{"key":"yngve@vivaldi.com","avatar":null},"body":"Hello again,\n\nAFAICT I have not seen any updates about this problem since my previous \nemail a year ago.\n\n From my side, I've just noticed a separate aspect of this issue.\n\nI have noticed a lot of failures related to a specific commit that was a \nunadvertised, and on one of the machines throwing this error, Git did \nreport the repos and paths involved in triggering the error.\n\nIn this case, the commit DO exists in the repo specified by gitmodules on \nthe branch where the submodule commit is referenced. However, it does NOT \nexist in the repo referenced by the currently checked out branch!\n\nIn more detail, for a currently checked out branch \"foo\", a submodule with \nURL \"repo1.git\" is specified for path \"submodule/mysub\" and commit \n\"f0012345\".\n\nOn branch \"bar\" of this top repo, the \"submodule/mysub\" is specified with \nthe URL \"repo2.git\", which is a fork of \"repo1.git\", and is specifying \ncommit \"ba598765\", which does not exist in \"repo1.git\"\n\nWhen a fetch is done in the checkout of the \"foo\" branch, the new branch \n\"bar\" is fetched, and Git sees the submodule commit \"ba598765\" specified \nfor \"submodule/mysub\", and decides to fetch it. However, it tries to fetch \nit from \"repo1.git\", NOT \"repo2.git\", which is what is specified for that \npath on the \"bar\" branch.\n\nThe result is a fatal error for the fetch, causing the automatic build job \nto fail, even if the \"ba598765\" commit is not necessary for the current \nbuild job's checkout.\n\nI've also added a server-side git hook to validate the primary submodule's \ncommit references, where most errors are likely to occur, but that is not \nable to prevent the kind of fetch failures described above, since the \nreference IS correct on the branch for which it is committed.\n\nAs mentioned earlier, IMO this should not be a fatal error when fetching, \nat most it should be a warning. Additionally, as illustrated by the above \nexample, when performing fetches for submodules the fetch operation should \nuse the URL specified on the branch, not the one specified in the local \ncheckout.\n\n\n\nOn Sunday, 6 September, 2020 14:47:47 (+02:00), Yngve N. Pettersen wrote:\n\n > Hello again,\n >\n > I wondered what is happening about this issue?\n >\n > This continues to cause problems, especially now that Mac is using Git \n2.21 (without AFAICT any way to revert to 2.17).\n >\n > The most recent case was last night, after a Work In Progress branch \n(that is, it was not used by any production code) in a submodule was \npushed, but updates for at least one of the submodules wasn't pushed. Three \ndifferent Mac autobuild jobs broke because of this error and had to be \nrestarted.\n >\n >\n > On Mon, 18 May 2020 11:20:57 +0200, Yngve N. Pettersen \n<yngve@vivaldi.com> wrote:\n >\n > > Hello all,\n > >\n > > A while back I reported an issue to the Windows Git project \n<https://github.com/git-for-windows/git/issues/2218> that I observed in Git \nfor Windows 2.21.\n > >\n > > The error message \"Server does not allow request for unadvertised \nobject\" is reported when a commit updating a submodule pointer points to a \ncommit that does not exist in the repository for that submodule, even if \nlater commits in the branch points to a commit that do exist in the \nsubmodule repo.\n > >\n > > This circumstance can easily occur if a developer (e.g)\n > >\n > > * interactively rebases a branch \"foo\" in the submodule (e.g to \nintegrate commits from another branch before a larger rebase)\n > > * commits the resulting submodule pointer \"A\" in the branch to the \nparent repo\n > > * then do further rebasing in the submodule, e.g to move up on top of \nthe \"bar\" branch\n > > * commits that pointer \"B\" to the parent repo\n > > * forgets to squash the history in the parent repo\n > > * pushes the updated submodule \"foo\" branch to the online repo. (NOTE: \n\"B\" is pushed, not \"A\")\n > > * pushes the parent module branch to its online repo\n > >\n > > When the parent repo is pulled by another developer, or an autobuild \nsystem, the fetch operation fails with the message \"Server does not allow \nrequest for unadvertised object\". A second fetch will complete \nsuccessfully.\n > >\n > > IMO this kind of check should only happen if a commit with pointer to \na missing submodule is actively checked out. At most the above message \nshould be a warning, not a fatal error.\n > >\n > > For manual fetch operations this is mostly a nuisance, but for \nautobuilders this breaks the update operation, and the entire build \noperation fails. That is unacceptable behavior in an automatic system \n(errors if it breaks the checkout, yes; issues that are not relevant to the \nactual checkout, no).\n > >\n > > This issue prevents upgrading past 2.17 (since 2.18 and 2.19 had other \nblocking issues, and 2.20 apparently introduced this issue). I have not \ntested 2.22+ since I have not noticed any changelog messages that seem \nrelated.\n > >\n > > A test case can be found in issue 2218, linked above.\n > >\n > > For reference, we do have a server-side git hook that verifies that \nsubmodule pointers for the production branch is correct and exists in the \nsubmodule's repo, and also is on branches that follows certain naming \nconventions.\n > >\n > >\n > > As an aside, I think this kind of error message would be have been \nbetter suited as either a client-side push check, to prevent pushes of \nreferences to such missing commits (Smartgit seems to have something like \nit, but I think it only checks for the current branch in the submodule, not \nall submodule reference commits). Alternatively, there could be a check of \nthis server-side.\n > >\n > >\n > > Related to this, but not as problematic, just irritating, and also \nseen in 2.17, is a message \"warning: Submodule in commit deadbee at path: \n'(NULL)' collides with a submodule named the same. Skipping it.\" I think it \nis related to recreating a git modules file on a different branch.\n > >\n >\n >\n-- \nSincerely,\nYngve N. Pettersen\nVivaldi Technologies AS\n"}]}