Closed sumanthratna closed 4 years ago
Which antibody version?
antibody version 5.0.0
(installed via brew
)
hmm weird, can you give me the output of
cd /Users/suman/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting
git rev-parse --abbrev-ref HEAD
git rev-parse HEAD
?
the git rev-parse HEAD
command printed 1a752da1c2f58bd96e1e09a83f53556060674f3f
.
and git rev-parse --abbrev-ref HEAD
?
it didn't output anything
EDIT: it actually printed master
, sorry for the confusion
hmm so that's the problem I think...
My bad, the directory didn't fit in my terminal so I didn't see the output the first time around. git rev-parse --abbrev-ref HEAD
outputted master
.
I have the same issue:
antibody: git update failed for /home/bubo/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh
antibody: git update failed for /home/bubo/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions
antibody: error: failed to update: object not found
Running the above commands:
❯ git rev-parse --abbrev-ref HEAD
master
❯ git rev-parse HEAD
a6e641b977373740e9744182e6fad9af9ff39bc5
EDIT:
I don't even have zsh-completions directly in my zsh_plugins.txt
, but it's probably picked up as a dependency?
zsh_plugins.txt
:
djui/alias-tips
mafredri/zsh-async
rupa/z
hlissner/zsh-autopair
changyuheng/fz
Tarrasch/zsh-bd
zimfw/completion
zimfw/input
zimfw/environment
zimfw/utility
romkatv/powerlevel10k
zdharma/fast-syntax-highlighting
zsh-users/zsh-history-substring-search
Getting a similar issue as well:
antibody: git update failed for /Users/jon/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions
antibody: error: failed to update: object not found
Output of that directory:
$ git rev-parse --abbrev-ref HEAD
master
$ git rev-parse HEAD
a6e641b977373740e9744182e6fad9af9ff39bc5
I just deleted everything from ~/.cache/antibody/
and ran:
antibody bundle < ~/.zsh_plugins.txt >! ~/.zsh_plugins.sh
antibody update
Now everything is correctly cloned and working. Running antibody update
again doesn't produce an error.
❯ antibody update
Updating all bundles in /home/bubo/.cache/antibody...
antibody: updating: https://github.com/zdharma/fast-syntax-highlighting
antibody: updating: https://github.com/mafredri/zsh-async
antibody: updating: https://github.com/hlissner/zsh-autopair
antibody: updating: https://github.com/rupa/z
antibody: updating: https://github.com/changyuheng/fz
antibody: updating: https://github.com/djui/alias-tips
antibody: updating: https://github.com/Tarrasch/zsh-bd
antibody: updating: https://github.com/romkatv/powerlevel10k
antibody: updating: https://github.com/zimfw/completion
antibody: updating: https://github.com/zimfw/environment
antibody: updating: https://github.com/zimfw/input
antibody: updating: https://github.com/zimfw/utility
antibody: updating: https://github.com/zsh-users/zsh-history-substring-search
It seems that the failing plugins were some that I might have used previously but never cleaned up by antibody. So it tried to fetch updates for all cloned repos in .cache/antibody/
and not only the plugins I have in my zsh_plugins.txt
file.
do you folks have go
installed? if so, can you help me debug this?
package main
import (
"bytes"
"flag"
"log"
"gopkg.in/src-d/go-git.v4"
)
func handlerr(err error) {
if err != nil {
panic(err)
}
}
func main() {
folder := flag.String("dir", ".", "")
flag.Parse()
repo, err := git.PlainOpen(*folder)
handlerr(err)
log.Println("opened repo", *folder)
ref, err := repo.Head()
handlerr(err)
log.Printf("ref: %+v\n", ref)
wt, err := repo.Worktree()
handlerr(err)
var w bytes.Buffer
if err := wt.Pull(&git.PullOptions{
RemoteName: "origin",
ReferenceName: ref.Name(),
SingleBranch: true,
Depth: 1,
RecurseSubmodules: 1,
Progress: &w,
Force: true,
}); err != git.NoErrAlreadyUpToDate {
log.Println("update failed for", *folder, w.String())
handlerr(err)
}
log.Println("updated: ", w.String())
}
put it as main.go
somewhere, and then:
go run main.go -dir $PATH_TO_BROKEN_PLUGIN
# eg: /home/bubo/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh
and paste it here...
if you need I can provide the binaries as well
It seems that the failing plugins were some that I might have used previously but never cleaned up by antibody. So it tried to fetch updates for all cloned repos in
.cache/antibody/
and not only the plugins I have in myzsh_plugins.txt
file.
yes, this is what it does... I'm thinking some old version of antibody cloned some plugins in a funky way and its causing this now...
you can always workaround with rm -rf "$(antibody home)"
Good thing that my main language is Go :) I will try it out and come back.
BTW: if anyone wants to zip a broken plugin and upload here that also helps a lot! thanks!
This is the output:
2020/03/23 15:46:01 opened repo /home/bubo/.local/share/Trash/files/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions
2020/03/23 15:46:01 ref: a6e641b977373740e9744182e6fad9af9ff39bc5 refs/heads/master
2020/03/23 15:46:01 update failed for /home/bubo/.local/share/Trash/files/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions
panic: object not found
goroutine 1 [running]:
main.handlerr(...)
/tmp/anti/main.go:13
main.main()
/tmp/anti/main.go:43 +0x711
exit status 2
It seems that the failing plugins were some that I might have used previously but never cleaned up by antibody. So it tried to fetch updates for all cloned repos in
.cache/antibody/
and not only the plugins I have in myzsh_plugins.txt
file.yes, this is what it does... I'm thinking some old version of antibody cloned some plugins in a funky way and its causing this now...
you can always workaround with
rm -rf "$(antibody home)"
Note to others (if you're on a mac):
rm -rf "$(antibody home)"
mdkir ~/Library/Caches/antibody
antibody bundle < ~/.zsh_plugins.txt > ~/.zsh_plugins.sh
antibody update
This is the output:
2020/03/23 15:46:01 opened repo /home/bubo/.local/share/Trash/files/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions 2020/03/23 15:46:01 ref: a6e641b977373740e9744182e6fad9af9ff39bc5 refs/heads/master 2020/03/23 15:46:01 update failed for /home/bubo/.local/share/Trash/files/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions panic: object not found goroutine 1 [running]: main.handlerr(...) /tmp/anti/main.go:13 main.main() /tmp/anti/main.go:43 +0x711 exit status 2
And if the clear-cache workaround is used, this is the output:
2020/03/23 10:48:22 opened repo /Users/suman/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting
2020/03/23 10:48:22 ref: d1802e388e94aca25380a3a9aeb4a2b7ba661b41 refs/heads/master
2020/03/23 10:48:23 updated:
@sumanthratna can you zip that plugin folder and upload here? I'll need to look into it 🤔
v5 uses go-git, so that's probably the issue, but I need to see what exactly is causing it 🤔
@sumanthratna can you zip that plugin folder and upload here? I'll need to look into it 🤔
I was going to upload the zip but I applied the workaround, so now the plugin works ://. I'll send it anyway, in case it helps.
https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting.zip
thanks!
oh, you don't have the previous broken version anymore?
No, I don't have it, sorry. I made the mistake of using rm -rf
instead of moving to trash.
no problem, maybe someone else has it still.
I'm thinking maybe we can make thing simpler and just use
package main
import (
"bytes"
"flag"
"log"
"gopkg.in/src-d/go-git.v4"
)
func handlerr(err error) {
if err != nil {
panic(err)
}
}
func main() {
folder := flag.String("dir", ".", "")
flag.Parse()
repo, err := git.PlainOpen(*folder)
handlerr(err)
wt, err := repo.Worktree()
handlerr(err)
var w bytes.Buffer
if err := wt.Pull(&git.PullOptions{
RemoteName: "origin",
Progress: &w,
}); err != git.NoErrAlreadyUpToDate {
log.Println("update failed for", *folder, w.String())
handlerr(err)
}
log.Println("updated: ", w.String())
}
instead (removed a bunch of pull options)...
I can send it to you, my rm
is aliased to safe-rm
.
Zip: https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions.zip
thankkkkkks!
seems like https://github.com/go-git/go-git/pull/5
I think some plugins were maybe force pushed, and that's causing the issue... git
probably handles it better than go-git 🤔
~/Downloads/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions master ⇣⇡
λ git pull
From https://github.com/zsh-users/zsh-completions
* [new tag] 0.31.0 -> 0.31.0
fatal: refusing to merge unrelated histories
not really, I think previous antibody was just eating the error somewhere...
@caarlos0 should plugins not in zsh_plugins.txt
be deleted from antibody's home directory when running antibody update
? I had a lot of directories in antibody's home that weren't in my zsh_plugins.txt
.
@caarlos0 should plugins not in
zsh_plugins.txt
be deleted from antibody's home directory when runningantibody update
? I had a lot of directories in antibody's home that weren't in myzsh_plugins.txt
.
antibody doesn't know about the zsh_plugins.txt
when updating... that's why it updates everything there...
releasing v5.0.1 which will have a more detailed error message about this...
closing as it was actually a bug on previous versions...
thanks for the help everyone! 🚀
ok this just happened with a repo that didn't had any force-push...
I give up, will revert to os.exec git.
Here's my
plugins.txt
:antibody bundle < plugins.txt > .plugins.sh
results in:antibody update
fails with the following error: