Monday 10 June 2019

Glide and Permissions - "Unable to update repository: exit status 255"

When using Go and Glide, one may see messages such as this: -

[WARN] Download failed.
[ERROR] Update failed for github.com/gorilla/securecookie: Unable to update repository: exit status 255
[WARN] Download failed.
[ERROR] Update failed for github.com/gin-gonic/gin: Unable to update repository: exit status 255
[WARN] Download failed.
[ERROR] Update failed for github.com/dgrijalva/jwt-go: Unable to update repository: exit status 255
[WARN] Download failed.
[ERROR] Update failed for gopkg.in/mgo.v2: Unable to update repository: exit status 255
[ERROR] Failed to do initial checkout of config: Unable to update repository: exit status 255
Unable to update repository: exit status 255
Unable to update repository: exit status 255
Unable to update repository: exit status 255

during the glide update process: -

glide update

Chances are it's permissions related ....

I saw this today - thinking that it might be a cache issue, I tried to clear the Glide Cache: -

glide cc

which failed with: -

[ERROR] Unable to clear the cache: unlinkat /home/hayd/.glide/cache/src/https-github.com-googleapis-gnostic/discovery/discovery.proto: permission denied

which reminded me that I'd been going back and forth between my non-root user and root ( via sudo ).

I fixed this as follows: -

sudo chown -R hayd:hayd /home/hayd/.glide

and then re-ran: -

glide cc

which worked as expected: -

[INFO] Glide cache has been cleared.

I was then able to update the Glide dependencies: -

glide update

Nice !

No comments:

Visual Studio Code - Wow 🙀

Why did I not know that I can merely hit [cmd] [p]  to bring up a search box allowing me to search my project e.g. a repo cloned from GitHub...