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

Large file, error and overwritten file #1190

Open
xeor opened this issue Dec 21, 2024 · 1 comment
Open

Large file, error and overwritten file #1190

xeor opened this issue Dec 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@xeor
Copy link

xeor commented Dec 21, 2024

I have a semi-large file, ~450 lines and 17k which sent silverbullet into 100% cpu when editing.
It might be the same issue as #1010, but I'm not sure.

I'm running nginx in front as well, all in kubernets as containers.

I was experimenting with editing the file by restarting the silverbullet container when it had locked up.
All the sudden, I noticed that my note had changed, it got replaced by the text

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

Here are the logs from nginx when the file was overwritten

2024/12/21 22:12:25 [error] 7850#7850: *58557079 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /index.json HTTP/2.0", upstream: "http://10.42.0.137:3000/index.json", host: "note.mydomain.com"
2024/12/21 22:12:25 [error] 7850#7850: *58557079 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /bignote.md HTTP/2.0", upstream: "http://10.42.0.137:3000/bignote.md", host: "note.mydomain.com"
2024/12/21 22:12:25 [error] 7850#7850: *58557079 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /index.json HTTP/2.0", upstream: "http://10.42.0.137:3000/index.json", host: "note.mydomain.com"
2024/12/21 22:12:25 [error] 7850#7850: *58557079 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /index.json HTTP/2.0", upstream: "http://10.42.0.137:3000/index.json", host: "note.mydomain.com"
2024/12/21 22:12:25 [error] 7850#7850: *58557079 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /bignote.md HTTP/2.0", upstream: "http://10.42.0.137:3000/bignote.md", host: "note.mydomain.com"
2024/12/21 22:12:25 [error] 7850#7850: *58557079 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /index.json HTTP/2.0", upstream: "http://10.42.0.137:3000/index.json", host: "note.mydomain.com"
2024/12/21 22:12:25 [error] 7850#7850: *58557079 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /index.json HTTP/2.0", upstream: "http://10.42.0.137:3000/index.json", host: "note.mydomain.com"
2024/12/21 22:12:25 [error] 7850#7850: *58557079 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /bignote.md HTTP/2.0", upstream: "http://10.42.0.137:3000/bignote.md", host: "note.mydomain.com"
2024/12/21 22:12:25 [error] 7850#7850: *58557079 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.1.2.3, server: note.mydomain.com, request: "GET /index.json HTTP/2.0", upstream: "http://10.42.0.137:3000/index.json", host: "note.mydomain.com"

I can't find anything interesting in the silverbullet log..

Any way this can be preventable? Overwriting a note by an error message should not happen. I guess in this case that the client have received the error, and written it because it's the "new" version of the file. But if the file received does not have a 200 status-code, maybe it should just pop an error saying "problems receiving" file? What do you think?

@zefhemel zefhemel added the bug Something isn't working label Jan 8, 2025
@zefhemel
Copy link
Collaborator

zefhemel commented Jan 8, 2025

Not sure why this would happen, but I agree that if the client gets a status code that is an error it shouldn't use that content for reloading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants