"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Johannes Thyssen Tishman <lists@thyssentishman.com>
Subject:
Re: mkstemp: Permission denied
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 2 Jun 2023 17:44:58 +0200

Download raw body.

Thread
On Fri, Jun 02, 2023 at 03:20:18PM +0200, Omar Polo wrote:
> Hello,
>
> On 2023/06/02 12:54:27 +0200, Johannes Thyssen Tishman <lists@thyssentishman.com> wrote:
> > Hi again,
> >
> > In my previous email[0] I described a how I found a way to keep the
> > worktree and the cloned repo on the same directory:
> >
> >     $ mkdir test && cd test
> >     $ got clone ssh://user@example.com/test .got
> >     $ got checkout -E .got .
> >
> > However when doing this, I'm getting the following error on 'got add
> > file':
> >
> > got: mkstemps: /path/to/worktree/.got/file-index-OJVI2Q: Permission
> > denied
>
> yep, it's not the intended way to use the tool.  ".got" in a worktree
> is used to store other metadata, not the repository itself.  You might
> be lucky using another directory, e.g. ".repo", but I would suggest
> keeping your stuff elsewhere.  I have a ~/git/ directory for that, but
> other places are fine.  When I started using got I used to create
> foo/foo.repo with the bare repository and checkout the worktrees as
> foo/main, foo/branch-x, etc.

Ah interesting. Would you mind telling me more about your workflow? You
keep your repos under ~/git and where do you keep your worktrees?

> > I suppose this is my fault as this is probably not the intended
> > workflow. However I'm also getting a similar error on 'got send' after a
> > commit when using the regular workflow:
> >
> > 2 commits colored; 3 objects found; 2 trees scanned
> > packing 1 reference; 3 objects; deltify: 100%; uploading pack:  263B 100%gotsh: mkstemp: Permission denied
> > got-send-pack: mkstemp: Permission denied
> >
> > got: could not send pack file
>
> This has nothing to do with your local setup, it's an error from the
> server (that could be printed nicely...)
>
> > The 'origin' remote url uses the user that I've specified on
> > /etc/gotd.conf with read-write access (which is not the same as my local
> > machine user).
>
> I suppose that the user gotd is running as (_gotd?) doesn't have the
> right permissions for the repo.  When you're using gotd, it should be
> its user to have RW permissions on the bare repository, not the user
> you're ssh'ing to (although that user needs to be `permit'-ted in the
> repository stanza of gotd.conf)

Yes you are right. gotd was running as _gotd but all my repos had the
wrong owner:group. I changed them all to _gotd:_gotd and now it works.

> Can you show an excerpt of your gotd.conf and `ls -lah path/to/repo' ?
>
>
> Thanks,
>
> Omar Polo

Thanks for your help Omar :)

--
Johannes Thyssen Tishman
https://thyssentishman.com