"Object not found" running abra recipe sync gitea #433

Closed
opened 2023-03-15 20:19:54 +00:00 by 3wordchant · 8 comments
Owner

Steps to reproduce:

  1. Run abra recipe upgrade gitea && abra recipe sync gitea

Expected:

  • Changes label

Actual:

  • Crash with "Object not found", traceback pointing to L137 of cli/recipe/sync.go
Steps to reproduce: 1. Run `abra recipe upgrade gitea && abra recipe sync gitea` Expected: - Changes label Actual: - Crash with "Object not found", traceback pointing to L137 of cli/recipe/sync.go
3wordchant added the
bug
label 2023-03-15 20:19:54 +00:00
Member

I have the same issue with some recipes . I could trace it down to the function repo.TagObject(ref.Hash()) 9e05000476/cli/recipe/sync.go (L119) . Anyhow this function can not find some commits by the given hash. I printed the failing commit hash and I could manually check out into this commit without any problems.
At the moment I have to increase the version number manually for some recipes.
Maybe anything in the repos is broken and abra is not able to catch it.

I have the same issue with some recipes . I could trace it down to the function `repo.TagObject(ref.Hash())` https://git.coopcloud.tech/coop-cloud/abra/src/commit/9e05000476283bad1ab16db29b69ecedc9117845/cli/recipe/sync.go#L119 . Anyhow this function can not find some commits by the given hash. I printed the failing commit hash and I could manually check out into this commit without any problems. At the moment I have to increase the version number manually for some recipes. Maybe anything in the repos is broken and abra is not able to catch it.
Owner

Thanks for looking @moritz. I think it's failing to read the tags or? I think we might just need to make sure we are updating the recipe / fetching all tags before running this iterator against commits which pulls out a tag version number and does a compare?

Thanks for looking @moritz. I think it's failing to read the tags or? I think we might just need to make sure we are updating the recipe / fetching all tags before running this iterator against commits which pulls out a tag version number and does a compare?
Member

I think that's not the problem the tags are updated inside the repo and abra can figure out the commit hash for all the given tags but anyhow the function repo.TagObject(ref.Hash()) can not find the commit by the given hash.

I think that's not the problem the tags are updated inside the repo and abra can figure out the commit hash for all the given tags but anyhow the function `repo.TagObject(ref.Hash())` can not find the commit by the given hash.
Author
Owner

I agree @moritz, when I hit this issue I was able to run the equivalent git commands successfully, so I'm unsure of the cause.

I agree @moritz, when I hit this issue I was able to run the equivalent git commands successfully, so I'm unsure of the cause.
decentral1se added this to the Critical fixes project 2023-05-08 09:45:46 +00:00
decentral1se added the
abra
label 2023-06-08 09:19:24 +00:00
Author
Owner

Also happening on custom-html

Also happening on `custom-html`
Owner

I'm picking this one up.

Upgraded to latest go-git and there's a new error message. Which helped me remember that this bug has to do with lightweight tags vs. annotated tags (wtf are those you ask? great question! here's the tldr: link) 😵‍💫

The original stack trace (0.7.0-beta):

FATA[0002] object not found caller="/home/d/work/coop-cloud/abra/cli/recipe/sync.go:137 glob..func6" stack="/home/d/work/coop-cloud/abra/cli/recipe/sync.go:137 glob..func6\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:524 HandleAction\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:173 Command.Run\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:405 (*App).RunAsSubcommand\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:378 Command.startApp\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:102 Command.Run\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:277 (*App).Run\n/home/d/work/coop-cloud/abra/cli/cli.go:200 RunApp\n/home/d/work/coop-cloud/abra/cmd/abra/main.go:22 main\n/usr/local/go/src/runtime/internal/atomic/types.go:194 (*Uint32).Load\n/usr/local/go/src/runtime/asm_amd64.s:1598 goexit"

On latest head, with latest deps:

? select recipe version increment type minor
FATA[0001] Tag at commit ff1b271545ee515c2719b7b3dfb484ea03f83551 is unannotated or otherwise broken. Please fix it. caller="/home/d/work/coop-cloud/abra/cli/recipe/sync.go:121 glob..func6.1" stack="/home/d/work/coop-cloud/abra/cli/recipe/sync.go:121 glob..func6.1\n/home/d/go/pkg/mod/github.com/go-git/go-git/v5@v5.8.0/plumbing/storer/reference.go:82 (*referenceFilteredIter).ForEach\n/home/d/work/coop-cloud/abra/cli/recipe/sync.go:118 glob..func6\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:524 HandleAction\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:173 Command.Run\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:405 (*App).RunAsSubcommand\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:378 Command.startApp\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:102 Command.Run\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:277 (*App).Run\n/home/d/work/coop-cloud/abra/cli/cli.go:200 RunApp\n/home/d/work/coop-cloud/abra/cmd/abra/main.go:22 main\n/usr/local/go/src/runtime/internal/atomic/types.go:194 (*Uint32).Load\n/usr/local/go/src/runtime/asm_amd64.s:1598 goexit"

Where Tag at commit ff1b271545ee515c2719b7b3dfb484ea03f83551 is unannotated or otherwise broken. Please fix it. was an artifact of the time we implemented the tag handling and learned that go-git makes a difference between lightweight/annotated and decided that we have no idea how to resolve this and we hope everyone annotates their tags 😬 /cc @knoflook

I was able to check out that commit (and other which it complained about) and run the following in the gitea recipe directory. Then I could sync again successfully with abra.

git tag -d 1.3.1+1.17.3-rootless
git tag -d 2.1.2+1.19.3-rootless

One was a tag I made and another by @javielico.

From this SO answer, I can confirm:

🌻 git for-each-ref refs/tags
734045872a57d795cd54b1992a1753893a4934f1 tag	refs/tags/1.0.0+1.14.5-rootless
b2cefa5ccf2f2f77dae54cf6c304cccecb3547ca tag	refs/tags/1.1.0+1.15.0-rootless
6d669112d8caafcdcf4eb1485f2d6afdb54a8e30 tag	refs/tags/1.1.1+1.15.3-rootless
64761ad187cc7a3984a37dd9abd4fa16979f97b9 tag	refs/tags/1.1.2+1.15.6-rootless
1ccb1cb6a63a08eebf6ba5508b676eaaccba7ed8 tag	refs/tags/1.1.3+1.15.10-rootless
b86e1f6dfef3c464b16736274b3cd95f8978f66b tag	refs/tags/1.2.0+1.16.3-rootless
b1d22f3c39ca768a4efa1a0b9b9f780268c924b3 tag	refs/tags/1.2.1+1.16.8-rootless
85a45aa749427822a73ef62b6362d57bae1a61af tag	refs/tags/1.3.0+1.17.2-rootless
f35689989c0b57575b8362e1252476d8133dc961 commit	refs/tags/1.3.1+1.17.3-rootless
df015fae592fca7728a3f0835217e110da4dbafc tag	refs/tags/2.0.0+1.18.0-rootless
71920adb0c25a59f7678894e39f1a705f0ad08dd tag	refs/tags/2.0.1+1.18.2-rootless
1ab9a96922341c8e54bdb6d60850630cce4b9587 tag	refs/tags/2.1.0+1.18.5-rootless
1e612d84a2ad7c9beb7aa064701a520c7e91eecc commit	refs/tags/2.1.2+1.19.3-rootless
0bee99615a8bbd534a66a315ee088af3124e054b tag	refs/tags/2.2.0+1.19.3-rootless
16f705fd68342593f99bf7d1e04cecf53c95fc32 tag	refs/tags/2.3.0+1.20.1-rootless

This is a useful command to checking what tags are borked in a recipe.

What is confusing af is that ff1b271545ee515c2719b7b3dfb484ea03f83551 (the hash in the abra error message) doesn't even appear in the git log output! But you can git checkout ff1b271545ee515c2719b7b3dfb484ea03f83551 which points to f35689989c0b57575b8362e1252476d8133dc961 but somehow without the tag... 🤯 I guess that is the source of the issue, how Git is internally handling the tags types. I don't think we can code around this...

In practice, this means, you always need to pass git tag -a ... and if you don't, sadness like this.

@3wordchant @moritz do you have any ideas where go from here? My thoughts:

  • add a lint rule to recipe linting which errors out if it finds lightweight tags
  • document how to unfuck a lightweight tag into an annotated tag after your realise it's lightweight and abra chokes on it
I'm picking this one up. Upgraded to latest `go-git` and there's a new error message. Which helped me remember that this bug has to do with lightweight tags vs. annotated tags (wtf are those you ask? great question! here's the tldr: [link](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag#:~:text=Annotated%20tags%20store%20extra%20meta,quick%20links%20to%20relevant%20commits.)) 😵‍💫 The original stack trace (`0.7.0-beta`): > FATA[0002] object not found caller="/home/d/work/coop-cloud/abra/cli/recipe/sync.go:137 glob..func6" stack="/home/d/work/coop-cloud/abra/cli/recipe/sync.go:137 glob..func6\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:524 HandleAction\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:173 Command.Run\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:405 (*App).RunAsSubcommand\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:378 Command.startApp\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:102 Command.Run\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:277 (*App).Run\n/home/d/work/coop-cloud/abra/cli/cli.go:200 RunApp\n/home/d/work/coop-cloud/abra/cmd/abra/main.go:22 main\n/usr/local/go/src/runtime/internal/atomic/types.go:194 (*Uint32).Load\n/usr/local/go/src/runtime/asm_amd64.s:1598 goexit" On latest head, with latest deps: > ? select recipe version increment type minor > FATA[0001] Tag at commit ff1b271545ee515c2719b7b3dfb484ea03f83551 is unannotated or otherwise broken. Please fix it. caller="/home/d/work/coop-cloud/abra/cli/recipe/sync.go:121 glob..func6.1" stack="/home/d/work/coop-cloud/abra/cli/recipe/sync.go:121 glob..func6.1\n/home/d/go/pkg/mod/github.com/go-git/go-git/v5@v5.8.0/plumbing/storer/reference.go:82 (*referenceFilteredIter).ForEach\n/home/d/work/coop-cloud/abra/cli/recipe/sync.go:118 glob..func6\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:524 HandleAction\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:173 Command.Run\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:405 (*App).RunAsSubcommand\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:378 Command.startApp\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:102 Command.Run\n/home/d/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:277 (*App).Run\n/home/d/work/coop-cloud/abra/cli/cli.go:200 RunApp\n/home/d/work/coop-cloud/abra/cmd/abra/main.go:22 main\n/usr/local/go/src/runtime/internal/atomic/types.go:194 (*Uint32).Load\n/usr/local/go/src/runtime/asm_amd64.s:1598 goexit" Where `Tag at commit ff1b271545ee515c2719b7b3dfb484ea03f83551 is unannotated or otherwise broken. Please fix it.` was an artifact of the time we implemented the tag handling and learned that `go-git` makes a difference between lightweight/annotated and decided that we have no idea how to resolve this and we hope everyone annotates their tags 😬 /cc @knoflook I was able to check out that commit (and other which it complained about) and run the following in the `gitea` recipe directory. Then I could sync again successfully with `abra`. ``` git tag -d 1.3.1+1.17.3-rootless git tag -d 2.1.2+1.19.3-rootless ``` One was a tag I made and another by @javielico. From this [SO answer](https://stackoverflow.com/a/40499437), I can confirm: ``` 🌻 git for-each-ref refs/tags 734045872a57d795cd54b1992a1753893a4934f1 tag refs/tags/1.0.0+1.14.5-rootless b2cefa5ccf2f2f77dae54cf6c304cccecb3547ca tag refs/tags/1.1.0+1.15.0-rootless 6d669112d8caafcdcf4eb1485f2d6afdb54a8e30 tag refs/tags/1.1.1+1.15.3-rootless 64761ad187cc7a3984a37dd9abd4fa16979f97b9 tag refs/tags/1.1.2+1.15.6-rootless 1ccb1cb6a63a08eebf6ba5508b676eaaccba7ed8 tag refs/tags/1.1.3+1.15.10-rootless b86e1f6dfef3c464b16736274b3cd95f8978f66b tag refs/tags/1.2.0+1.16.3-rootless b1d22f3c39ca768a4efa1a0b9b9f780268c924b3 tag refs/tags/1.2.1+1.16.8-rootless 85a45aa749427822a73ef62b6362d57bae1a61af tag refs/tags/1.3.0+1.17.2-rootless f35689989c0b57575b8362e1252476d8133dc961 commit refs/tags/1.3.1+1.17.3-rootless df015fae592fca7728a3f0835217e110da4dbafc tag refs/tags/2.0.0+1.18.0-rootless 71920adb0c25a59f7678894e39f1a705f0ad08dd tag refs/tags/2.0.1+1.18.2-rootless 1ab9a96922341c8e54bdb6d60850630cce4b9587 tag refs/tags/2.1.0+1.18.5-rootless 1e612d84a2ad7c9beb7aa064701a520c7e91eecc commit refs/tags/2.1.2+1.19.3-rootless 0bee99615a8bbd534a66a315ee088af3124e054b tag refs/tags/2.2.0+1.19.3-rootless 16f705fd68342593f99bf7d1e04cecf53c95fc32 tag refs/tags/2.3.0+1.20.1-rootless ``` This is a useful command to checking what tags are borked in a recipe. What is confusing af is that `ff1b271545ee515c2719b7b3dfb484ea03f83551` (the hash in the `abra` error message) doesn't even appear in the `git log` output! But you can `git checkout ff1b271545ee515c2719b7b3dfb484ea03f83551` which points to `f35689989c0b57575b8362e1252476d8133dc961` but somehow without the tag... 🤯 I guess that is the source of the issue, how Git is internally handling the tags types. I don't think we can code around this... In practice, this means, you **always** need to pass `git tag -a ...` and if you don't, sadness like this. @3wordchant @moritz do you have any ideas where go from here? My thoughts: - add a lint rule to recipe linting which errors out if it finds lightweight tags - document how to unfuck a lightweight tag into an annotated tag after your realise it's lightweight and `abra` chokes on it
decentral1se added spent time 2023-07-25 11:06:53 +00:00
40 minutes
Author
Owner

My thoughts:

  • add a lint rule to recipe linting which errors out if it finds lightweight tags
  • document how to unfuck a lightweight tag into an annotated tag after your realise it's lightweight and abra chokes on it

Sounds A+++

> My thoughts: > - add a lint rule to recipe linting which errors out if it finds lightweight tags > - document how to unfuck a lightweight tag into an annotated tag after your realise it's lightweight and abra chokes on it Sounds A+++
decentral1se self-assigned this 2023-07-25 11:53:51 +00:00
Owner
- https://git.coopcloud.tech/coop-cloud/docs.coopcloud.tech/commit/6a8ddfdb6b5a821d44be4f6cdb8da365b25807ae - https://git.coopcloud.tech/coop-cloud/abra/commit/4f22228aab269b7f714b5f90e5535074b2e0db16
decentral1se added spent time 2023-07-26 06:22:01 +00:00
15 minutes
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Total Time Spent: 55 minutes
decentral1se
55 minutes
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#433
No description provided.