git-bug push/pull: Error: knownhosts: illegal base64 data at input byte 0

Timeline

Andreas Abel (andreasabel) opened

I am encountering Error: knownhosts: illegal base64 data at input byte 0 when doing a git-bug push or pull. The reason seems to be that my known_hosts contains old entries in a format that is no longer parsed by whatever known-hosts parser git-bug uses. However, this is the first time that any tool has complained about my known_hosts, I have never seen this error before.

Example for an entry in an old format:

marla 1024 35 143272250049166269737933547513323306924766577123720650722107527190659497169427080068806092731824033696458717398748610005261225355371083583221684382067690973456312131412664967323591000249395847872463401148460758167467249589130631631765553643486839666676377810040253889511108563175629631040770556919699102015121

Deleting all entries in this decimal format (as opposed to base64) fixes the problem.

I don't know if this is worth fixing; however, the error isn't very clear. I am also a bit surprised why a tool like git-bug needs its own parser for known-hosts, isn't such abstracted in some kind of OS layer? (E.g. git does not have a problem with my known_hosts.)

sudoforge commented

we do not use a custom parser; we use go-git under the hood, which, unfortunately, i'm going to refer to as half-baked as it fails to support various things that you'd expect (e.g. the full configuration chain by default, includes and conditional includes, ssh and other protocol support, etc).

critically, the issue you're running into shouldn't happen when you push to or pull from a bridge (because this uses your API credentials). the issue lies within the normal git-bug-push and git-bug-pull commands.

this will be fixed in a future release, likely by reverting the decision to move to go-git for operations that interact with git remotes (which was done for security concerns to shelling out to git on the host machine).

because git-bug creates normal git objects, you can push and pull to the git remote using git. see https://github.com/git-bug/git-bug/discussions/1332 for more information.

Andreas Abel (andreasabel) commented

Thanks for the quick triage!

we do not use a custom parser; we use go-git under the hood, which, unfortunately, i'm going to refer to as half-baked as it fails to support various things that you'd expect (e.g. the full configuration chain by default, includes and conditional includes, ssh and other protocol support, etc).

Yes, this is somewhat what I expected but did not formulate properly: using some other parser than git and the other OS tools...

critically, the issue you're running into shouldn't happen when you push to or pull from a bridge (because this uses your API credentials). the issue lies within the normal git-bug-push and git-bug-pull commands.

I can confirm this, no issue with the bridge commands, just the git-bug push/pull.