Image not opening on page, but does open in a new tab. #22

Closed
opened 2025-05-18 16:16:59 +02:00 by ajlewis2 · 11 comments

Running ./bssg.sh server from the code directory works as expected.

An image on a page shows a dead link with no image, but I can open it in a new tab using that dead link.
The image does show up when I start the server the old way.

Running ./bssg.sh server from the code directory works as expected. An image on a page shows a dead link with no image, but I can open it in a new tab using that dead link. The image does show up when I start the server the old way.

This seems intermittent for me. Sometimes images load, sometimes not. Same with custom.css. I see "failed to load resource, cannot connect to the server" in console.

This seems intermittent for me. Sometimes images load, sometimes not. Same with custom.css. I see "failed to load resource, cannot connect to the server" in console.
Owner

Thanks. Is it a local image or a remote one? Which is the image extension/format?

Thanks. Is it a local image or a remote one? Which is the image extension/format?
stefano self-assigned this 2025-05-18 16:58:30 +02:00
Author

It is local.
Markdown is:

![gPodder](/images/gPodder.png)

output:

<p><img src="/images/gPodder.png" alt="gPodder" /></p>

It is local. Markdown is: ` ![gPodder](/images/gPodder.png)` output: `<p><img src="/images/gPodder.png" alt="gPodder" /></p>`
Owner

@ajlewis2 wrote in #22 (comment):

It is local. Markdown is:

![gPodder](/images/gPodder.png)

output:

<p><img src="/images/gPodder.png" alt="gPodder" /></p>

Perfect. Can you please paste the server debug output? It could help to identify as I had a similar problem with css files and had to fix the mime type detection.

@ajlewis2 wrote in https://brew.bsd.cafe/stefano/BSSG/issues/22#issuecomment-243: > It is local. Markdown is: > > ` ![gPodder](/images/gPodder.png)` > > output: > > `<p><img src="/images/gPodder.png" alt="gPodder" /></p>` Perfect. Can you please paste the server debug output? It could help to identify as I had a similar problem with css files and had to fix the mime type detection.

For me it's local .jpg images (plus the custom.css file, but that seems to have been temporary).

On my home page, there are two images. Sometimes, one or the other of them don't load. A reload often fixes it.

For me it's local .jpg images (plus the custom.css file, but that seems to have been temporary). On my home page, there are two images. Sometimes, one or the other of them don't load. A reload often fixes it.
Author

@stefano wrote in #22 (comment):

Perfect. Can you please paste the server debug output? It could help to identify as I had a similar problem with css files and had to fix the mime type detection.

Is this what you mean. This is from using --debug on the command and forwarding output to a text file. I did a different page, because after running --debug with the other page, the image appeared! That did not happen on this page with another .png file. is 'apng' a filetype. I see that in this text.

@stefano wrote in https://brew.bsd.cafe/stefano/BSSG/issues/22#issuecomment-244: > Perfect. Can you please paste the server debug output? It could help to identify as I had a similar problem with css files and had to fix the mime type detection. Is this what you mean. This is from using --debug on the command and forwarding output to a text file. I did a different page, because after running --debug with the other page, the image appeared! That did not happen on this page with another .png file. is 'apng' a filetype. I see that in this text.
Author

Accidentally clicked "close" I think. I'm sorry.

Accidentally clicked "close" I think. I'm sorry.
stefano reopened this issue 2025-05-18 17:51:29 +02:00
Owner

I think I found the issue. It's a concurrency problem: netcat is single threaded, so it will serve the html and then restart. So the other files (media files, mainly) will find a connection refused. I'm not hosting media files locally, so I didn't notice it. I'm going to revamp another implementation of the server part - I preferred netcat for portability, but will probably adapt the socat version.

I think I found the issue. It's a concurrency problem: netcat is single threaded, so it will serve the html and then restart. So the other files (media files, mainly) will find a connection refused. I'm not hosting media files locally, so I didn't notice it. I'm going to revamp another implementation of the server part - I preferred netcat for portability, but will probably adapt the socat version.
Owner

Could you please try to update to the latest commit, install socat and try again? Thank you!

Could you please try to update to the latest commit, install *socat* and try again? Thank you!
Author

@stefano wrote in #22 (comment):

Could you please try to update to the latest commit, install socat and try again? Thank you!

Looks good! Images load and I'm not getting that on and off css loading. Thanks. This is a nice addition.

@stefano wrote in https://brew.bsd.cafe/stefano/BSSG/issues/22#issuecomment-251: > Could you please try to update to the latest commit, install _socat_ and try again? Thank you! Looks good! Images load and I'm not getting that on and off css loading. Thanks. This is a nice addition.
Owner

@ajlewis2 wrote in #22 (comment):

@stefano wrote in #22 (commento):

Could you please try to update to the latest commit, install socat and try again? Thank you!

Looks good! Images load and I'm not getting that on and off css loading. Thanks. This is a nice addition.

Perfect! Thank you for your feedback!

@ajlewis2 wrote in https://brew.bsd.cafe/stefano/BSSG/issues/22#issuecomment-252: > @stefano wrote in #22 (commento): > > > Could you please try to update to the latest commit, install _socat_ and try again? Thank you! > > Looks good! Images load and I'm not getting that on and off css loading. Thanks. This is a nice addition. Perfect! Thank you for your feedback!
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: stefano/BSSG#22
No description provided.