Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Not a directory" when trying to start josh #1032

Closed
RalfJung opened this issue Nov 15, 2022 · 8 comments
Closed

"Not a directory" when trying to start josh #1032

RalfJung opened this issue Nov 15, 2022 · 8 comments
Assignees

Comments

@RalfJung
Copy link
Contributor

I have always started josh as follows when running the proxy locally:

cargo run --release -p josh-proxy -- --local=$(pwd)/local --remote=https://github.com --no-background

However somehow that does not seem to work any more? I just updated to latest master, and when I do this now, I get the following:

2022-11-15T15:47:23.132082Z DEBUG josh_proxy: init mirror repo: "/home/r/src/rust/josh/local/mirror"
2022-11-15T15:47:23.178500Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "http.receivepack", "true"] env=[]
2022-11-15T15:47:23.181509Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "user.name", "josh"] env=[]
2022-11-15T15:47:23.184226Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "user.email", "[email protected]"] env=[]
2022-11-15T15:47:23.186698Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "uploadpack.allowAnySHA1InWant", "true"] env=[]
2022-11-15T15:47:23.189425Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "uploadpack.allowReachableSHA1InWant", "true"] env=[]
2022-11-15T15:47:23.191771Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "uploadpack.allowTipSha1InWant", "true"] env=[]
2022-11-15T15:47:23.195140Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "receive.advertisePushOptions", "true"] env=[]
2022-11-15T15:47:23.197997Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "gc.auto", "0"] env=[]
2022-11-15T15:47:23.200438Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "credential.helper", "!f() { echo username=\"${GIT_USER}\"; echo password=\"${GIT_PASSWORD}\"; }; f"] env=[]
2022-11-15T15:47:23.200474Z ERROR josh: item=Os { code: 20, kind: NotADirectory, message: "Not a directory" } error=true

Sadly it does not say what is not a directory, so I don't know what is going wrong.

@RalfJung
Copy link
Contributor Author

RalfJung commented Nov 15, 2022

strace shows this around where the error is printed:

write(1, "2022-11-15T15:49:53.854281Z TRAC"..., 2112022-11-15T15:49:53.854281Z TRACE command_env: josh::shell: stdout="" stderr="" cmd=["git", "config", "credential.helper", "!f() { echo username=\"${GIT_USER}\"; echo password=\"${GIT_PASSWORD}\"; }; f"] env=[]
) = 211
statx(AT_FDCWD, "/home/r/src/rust/josh/local/mirror/hooks", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7fff80b86300) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/r/src/rust/josh/local/mirror/packed-refs", AT_STATX_SYNC_AS_STAT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=46, ...}) = 0
statx(AT_FDCWD, "/home/r/src/rust/josh/local/mirror/packed-refs", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=46, ...}) = 0
openat(AT_FDCWD, "/home/r/src/rust/josh/local/mirror/packed-refs", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = -1 ENOTDIR (Not a directory)
write(1, "2022-11-15T15:49:53.854502Z ERRO"..., 1212022-11-15T15:49:53.854502Z ERROR josh: item=Os { code: 20, kind: NotADirectory, message: "Not a directory" } error=true
) = 121

/home/r/src/rust/josh/local/mirror/packed-refs is indeed not a directory. It is a file. (But I might be misunderstanding what that openat call wants to do.)

@RalfJung
Copy link
Contributor Author

I think the problem was introduced by a973f60: that calls remove_dir_all on packed-refs, but remove_dir_all needs a directory, whereas the previous approach of calling rm -rf also works on files.

Cc @vlad-ivanov-name

@christian-schilling
Copy link
Member

The easy fix is to start from a clean volume. It means cache needs to be re-built, but that will happen anyways as CACHE_VERSION bumped for a bugfix.
Nevertheless this should of course be fixed. That for letting us know so quickly :)

@vlad-ivanov-name vlad-ivanov-name self-assigned this Nov 15, 2022
@RalfJung
Copy link
Contributor Author

Ah right, removing local also fixed this. Not sure why packed-ref existed as a file in the old dir...

@christian-schilling
Copy link
Member

Some time ago Josh used to create this file but does not anymore. This removal code is just there to cover upgrades from such old versions.

bors added a commit to rust-lang/miri that referenced this issue Nov 15, 2022
update josh instructions

josh-project/josh#965 and josh-project/josh#994 have been merged so we don't need a forked josh any more. :)

However, this is blocked on josh-project/josh#1032 which currently prevents me from actually testing this...
bors added a commit to rust-lang/miri that referenced this issue Nov 15, 2022
update josh instructions

josh-project/josh#965 and josh-project/josh#994 have been merged so we don't need a forked josh any more. :)

However, this is blocked on josh-project/josh#1032 which currently prevents me from actually testing this...
@RalfJung
Copy link
Contributor Author

I think it's not just old versions of josh... I deleted the file but it came back.^^

RalfJung pushed a commit to RalfJung/rust that referenced this issue Nov 15, 2022
update josh instructions

josh-project/josh#965 and josh-project/josh#994 have been merged so we don't need a forked josh any more. :)

However, this is blocked on josh-project/josh#1032 which currently prevents me from actually testing this...
@vlad-ivanov-name
Copy link
Collaborator

#1035

@christian-schilling
Copy link
Member

Fixed in #1035

RalfJung pushed a commit to RalfJung/miri that referenced this issue Nov 17, 2022
update josh instructions

josh-project/josh#965 and josh-project/josh#994 have been merged so we don't need a forked josh any more. :)

However, this is blocked on josh-project/josh#1032 which currently prevents me from actually testing this...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants