wiredlab / satnogs-partchanger

DEPRICATED. Go to https://gitlab.com/wiredlab/satnogs-partchanger for the current work. Web-based custom part STL generator for SatNOGS rotator parts
https://gitlab.com/wiredlab/satnogs-partchanger
GNU Affero General Public License v3.0
0 stars 1 forks source link

Error when cloning repo: "Server does not allow request for unadvertised object" #3

Open saintaardvark opened 6 years ago

saintaardvark commented 6 years ago

When I try cloning this repo, I see this error:

$ git clone --recursive git@github.com:wiredlab/satnogs-partchanger.git
Cloning into 'satnogs-partchanger'...
remote: Counting objects: 54, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 54 (delta 23), reused 46 (delta 18), pack-reused 3
Receiving objects: 100% (54/54), 24.63 KiB | 6.16 MiB/s, done.
Resolving deltas: 100% (23/23), done.
Submodule 'satnogs-rotator' (https://gitlab.com/wiredlab/satnogs-rotator.git) registered for path 'satnogs-rotator'
Cloning into '/tmp/satnogs-partchanger/satnogs-rotator'...
remote: Counting objects: 76, done.        
remote: Compressing objects: 100% (75/75), done.        

remote: Total 76 (delta 0), reused 63 (delta 0)        
error: Server does not allow request for unadvertised object a92dcf0d44812886812423267f5ba133ca2b9d3d
Fetched in submodule path 'satnogs-rotator', but it did not contain a92dcf0d44812886812423267f5ba133ca2b9d3d. Direct fetching of that commit failed.

I see the same error when I try git submodule init --update within the newly-cloned repo:

$ git submodule update --init
error: Server does not allow request for unadvertised object a92dcf0d44812886812423267f5ba133ca2b9d3d
Fetched in submodule path 'satnogs-rotator', but it did not contain a92dcf0d44812886812423267f5ba133ca2b9d3d. Direct fetching of that commit failed.

Is it possible that the submodule points at a branch or commit that hasn't been pushed to your satnogs-rotator repo?

etihwnad commented 6 years ago

The commit is present at the gitlab repository, in the constraint-names branch. I added shallow = true to .gitmodules but the option only works for git version >= 2.10. I have v2.7.4 everywhere, perhaps that is something?

Could have been a timing issue between me pushing each repo and you pulling. Both have been active lately :)

saintaardvark commented 6 years ago

This may be due to a change in git behaviour with shallow clones:

One workaround:

Of course, that results in a larger copy of the satnogs-rotator repo than is strictly necessary, but at least it works. It may be worth adding a note to the README about this workaround.

I'm not certain, but it looks like this StackExchange answer may describe this situation; the last part of that comment reads:

shallow = true on .gitmodules only affects the reference tracked by the HEAD of the remote when using --recurse-submodules, even if the target commit is pointed to by a branch, and even if you put branch = mybranch on the .gitmodules as well.