cobalt-org / cobalt.rs

Static site generator written in Rust
cobalt-org.github.io/
Apache License 2.0
1.37k stars 104 forks source link

Crashes when serving TempleOS website from subdirectory. #695

Closed brown121407 closed 4 years ago

brown121407 commented 4 years ago

The cobalt serve server starts well and is working as intended for posts and top level pages. I have a copy of the TempleOS website in an assets directory at assets/temple. When I access index.html from this directory, it works fine, but when I click on anything else afterwards, the server dies (note that the server is still alive after a first serve of something from assets/temple but dies after you do anything else from that point).

The last two lines of output:

[info] Watching "/home/brown121407/src/repos/git.sr.ht/brown121407/brown.121407.xyz/" for changes
[error] Connection reset by peer (os error 104)

Here is the repository: https://git.sr.ht/~brown121407/brown.121407.xyz

The deployed website works as expected - I can browse even after opening assets/temple/index.html. You can access the website here: https://brown.121407.xyz

epage commented 4 years ago

So let me see if I understand the reproduction step

  1. Get setup
    git clone https://git.sr.ht/~brown121407/brown.121407.xyz
    cd brown.121407.xyz
    cobalt serve
  2. Then browse to http://localhost:3000/assets/temple

Which links should I click to reproduce the crash? I've picked some random things but cobalt at HEAD doesn't crash (on my Macbook).

brown121407 commented 4 years ago

You seem to have done the things necessary for it to crash (if, after going to http://localhost:3000/assets/temple/index.html you tried going to any other address on the site, even plain http://localhost:3000, it should have died).

My cobalt --version is Cobalt 0.15.4 from the Arch Linux repos.

epage commented 4 years ago

I just published 0.15.5. If that doesn't work for you, I'll try reproducing on other machines.

Also, if you do run into this, could you run with verbose logging enabled in case there is more of a hint as to what is going on?

brown121407 commented 4 years ago

I have the same problem with your latest release.

Here is the output of cobalt serve --trace: https://paste.sr.ht/%7Ebrown121407/cb8baaa983c52f8303783cd2cdba00564b2ed9a4

epage commented 4 years ago

I was thinking of patching up the error handling but I figured it'd be better to go ahead and modernize the implementation. I'll let you know when #697 is in a release.

epage commented 4 years ago

v0.15.6 is now published.

brown121407 commented 4 years ago

The good news it that it doesn't crash anymore now :tada: .

The bad news is that cobalt serve no longer closes when I press Ctrl-C. It hangs with:

[info] SIGINT received, exiting

Should I open up a new issue for this?

epage commented 4 years ago

Yes, that should be a new issue