teleclimber / Dropserver

An application platform for your personal web services. https://dropserver.org
Apache License 2.0
42 stars 1 forks source link

panic following tutorial-app, on reload "no such file or directory" #118

Closed TrevorFSmith closed 8 months ago

TrevorFSmith commented 8 months ago

On Fedora 38 using ds-dev v0.11.0, I followed the tutorial app but every time I save app.ts the ds-dev panics:

set job to finished and sending
2023/10/11 19:02:03 sandbox/sandbox.go:579 a:11 v:1000.0.0 as:15 (Sandbox, Graceful()) sending twine.Graceful()
2023/10/11 19:02:03 sandbox/sandbox.go:584 a:11 v:1000.0.0 as:15 (Sandbox, Graceful()) graceful complete
2023/10/11 19:02:03 sandbox/sandbox.go:864 a:11 v:1000.0.0 as:15 (Sandbox, setStatus()) Sandbox 2 set status from 4 to 5
2023/10/11 19:02:03 sandbox/sandbox.go:661 a:11 v:1000.0.0 as:15 (Sandbox, cleanup()) cleanup complete
2023/10/11 19:02:03 sandbox/sandbox.go:864 a:11 v:1000.0.0 as:15 (Sandbox, setStatus()) Sandbox 2 set status from 5 to 6
panic: stat /home/trevor/Desktop/dropserver/tutorial-app/4913: no such file or directory

goroutine 41 [running]:
main.(*DevAppWatcher).watch.func1()
    /home/runner/work/Dropserver/Dropserver/cmd/ds-dev/appwatcher.go:179 +0x22d
created by main.(*DevAppWatcher).watch
    /home/runner/work/Dropserver/Dropserver/cmd/ds-dev/appwatcher.go:165 +0xdf

I tried a few variations on the command line with relative an full paths as well as setting or not setting the appspace option. It seems to make no difference.

teleclimber commented 8 months ago

Hi Trevor, thanks for reporting this.

Do you have an idea what /home/trevor/Desktop/dropserver/tutorial-app/4913 file might be? It doesn't sound like a code file you'd be creating. Maybe a temporary file?

I'm wondering if it's a file that gets created and then deleted in very quick succession, which trips up the file watcher algorithm. I can get around this is that's what it is.

TrevorFSmith commented 8 months ago

Hello. 4913 isn't a file that I've created, either manually or in code, so I'm not sure what it's meant to do or why it would appear in the tutorial-app directory. The name, "4913", is consistent though so it doesn't seem to be a per-process lockfile named after a process id.

Edit: I also looked into the tmp dir while ds-dev is running and there's no similarly named file. I thought it might be a relative path problem.

teleclimber commented 8 months ago

Hmm. Weird. I can't reproduce this on Arch or Mac.

Are you using vim by any chance? I just found this post that indicates vim creates a temporary file called 4913. I'll have to dive into this post and integrates the author's findings.

TrevorFSmith commented 8 months ago

I am using vim, well, nvim. I just read the linked post and indeed, I think that could explain what is happening.

TrevorFSmith commented 8 months ago

Thank you.