Web based family history software

Question 404 errors for all media after 2.1.0-beta.2 upgrade

  • nycvelo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago #1 by nycvelo
Greetings. I recently upgraded a FreeBSD system running webtrees 2.0.23 and php73 to webtrees-2.1.0-beta.2.zip and php80. This system uses nginx as a webserver.

The system serves pages OK with one big exception: No media object will display. In its place there is a red 404 box.

The odd thing is there is no 404 entry in the nginx error log. Further, the webtrees/data/media directory is in the correct place with the same permissions as in the previous version.

I could use some troubleshooting help in understanding what broke here. Thanks in advance.

Please Log in or Create an account to join the conversation.

  • nycvelo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago - 1 year 11 months ago #2 by nycvelo
ps. In the media tab for each individual, the thumbnails appear as red 404 squares.

Clicking the name of a media object brings up a page for that object, and that page does display a thumbnail.

However, clicking the thumbnail brings up a pop-up page with a "This image failed to load" display, again without nginx logging an error. Because the nginx error log does have other entries, I do not think nginx logging is an issue.
Last edit: 1 year 11 months ago by nycvelo. Reason: omitted log entries; deleted log entries, which were not from me but rather some random client on the Internet. Basic problem remains: 404 display without logging from requests for media objects

Please Log in or Create an account to join the conversation.

  • Czarnecki
  • Visitor
  • Visitor
1 year 11 months ago #3 by Czarnecki
I have the same problem. After the update to version 2.1. I have received messages with about 15 fatal warnings. The system is stuck saying the website is unavailable
.

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago - 1 year 10 months ago #4 by haraldino
Same problem here.
Except that I just installed the newest version (2.1.2).
Then I copied all my pics from an 2011-phpgedview-installation into the data/media/ - folder.
I already tried brutal right-changes (like recursive chmod 777 on /media/), nothing ...

Strange to see that the pics are recognized by name but only get displayed as red - 404 - box.
Maybe automatic thumbnails don't work?

Or is it the wrong path? It is shown in the installation-explanations of my installation as "/usr/www/users/mysqldb/webtrees/app/../data/" ... but I did NOT put it there, I put all the pics into /data/media/ for I HAVE no "media"-Folder in "app" but one in "data", I have to admit. Never saw sth like that.)
(And also I cannot understand the "/../" in the adress copied in above.

If u love freedom, dignity and sovereignty
use deepl.com, openstreemap.org e.g.
Last edit: 1 year 10 months ago by haraldino.

Please Log in or Create an account to join the conversation.

  • nycvelo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 10 months ago #5 by nycvelo
Any update on this? I'm still unable to determine the source of the 404 errors for images since upgrading to WT 2.1.x and PHP 8.0.

Thanks in advance for further troubleshooting clues.

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #6 by fisharebest
Replied by fisharebest on topic 404 errors for all media after 2.1.0-beta.2 upgrade
> Or is it the wrong path? It is shown in the installation-explanations of my installation as "/usr/www/users/mysqldb/webtrees/app/../data/" ...

Is what the wrong path.

What is the media folder for the tree? You can see this in the control panel, family tree, preferences.

The ".." means go up one folder.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • nycvelo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago #7 by nycvelo
Hi, I'm the original poster. I think my issue is different: Even after upgrading to 2.1.4 and checking permissions, I'm still seeing 404 errors for media. The nginx logs only show successful retrievals, no errors, and the media path is set correctly in the Control Panel.

Thanks in advance for further troubleshooting clues on finding the source of these 404 errors.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #8 by fisharebest
Replied by fisharebest on topic 404 errors for all media after 2.1.0-beta.2 upgrade
OK - give us a specific example to work with.

What is your data folder? (Control panel -> Website preferences)
What is your media folder? (Control panel -> Family tree -> Media folder)
What is the folder/filename of the media object? (From the media object's page)

Where have you stored this file on disk?

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago - 1 year 9 months ago #9 by haraldino
Sorry, didn't see fisharebests reaction before I posted the following!
Please disregard my post down here, work on nycvelos problem first!


Hello nycvelo! Sorry for possibly derailing ur thread.
But I still do think we have the same trouble.
I upgraded to 2.1.4 too now from a completely new a 2.1.2-installation and I have the same effects: Only 404-boxes.
But give me an info, if you want me to open another thread, no problem.

>
What is the media folder for the tree? You can see this in the control panel, family tree, preferences.

With the new installation little is better and the path is the standard path "/usr/www/users/wuitad/webtrees/app/../data/" and that is where I copied the pic-files into a subfolder "media". Little? Yes, for some persons I do no more get a 404-box but the standard pic, a grey silhouette of a standard but gender orientated head from the side.
So: I see the pics in the correct folder but 2.1.4 does not use them.
Even adding one by one doesn't change anything: "The file does not exist."
Maybe there is trouble with the thumbnails fabrication?
I add now a completely new file to a person where the file is NOT already uploaded into the data/media/-Folder.
Result: Works !

If u love freedom, dignity and sovereignty
use deepl.com, openstreemap.org e.g.
Last edit: 1 year 9 months ago by haraldino.

Please Log in or Create an account to join the conversation.

  • nycvelo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago - 1 year 9 months ago #10 by nycvelo

OK - give us a specific example to work with.

What is your data folder? (Control panel -> Website preferences)

data/

What is your media folder? (Control panel -> Family tree -> Media folder)

data/media/

What is the folder/filename of the media object? (From the media object's page)

The media object's page does not specify a folder or filename. There is a caption identifying people in the picture but no path or filename.

Where have you stored this file on disk?

All media objects live in /usr/local/www/webtrees/data/media

This is my page in Webtrees. The URL for the thumbnail image of my profile picture is:

arbor.potrzebie.org/index.php?route=%2Ft...sition=inline&mark=0

The data folder has 0777 permissions and is owned by root:wheel

The media folder has 0750 permissions and is owned by root:wheel

This particular filename is "LohoTadjudinNewman.jpg". It has 0644 permissions and is owned by root:wheel.

This the same directory structure and permissions that previously worked with previous versions of webtrees. The nginx logs do not show errors for the 404 red squares that appear instead of the media objects. Some objects on some pages do display thumbnails but then show 404 errors when clicking on those objects. Other objects do display as expected.

Again, thanks in advance for more troubleshooting clues.
Last edit: 1 year 9 months ago by nycvelo.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #11 by fisharebest
Replied by fisharebest on topic 404 errors for all media after 2.1.0-beta.2 upgrade
> The media object's page does not specify a folder or filename.

Filenames are only shown when you are logged in. Here is an example from the demo site. You can see the filename "Althorp_House.jpg"



The filename might include a folder as well. This folder name is important.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • nycvelo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago #12 by nycvelo

> The media object's page does not specify a folder or filename.

Filenames are only shown when you are logged in. Here is an example from the demo site. You can see the filename "Althorp_House.jpg"



The filename might include a folder as well. This folder name is important.

Clicking on the media object displays the 404 error, as shown in the first screenshot. Clicking on the caption shows the filename and a thumbnail image, as displayed in the second screenshot.

The photo is world-readable and is in the data/media folder that webtrees can see.
Attachments:

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #13 by fisharebest
Replied by fisharebest on topic 404 errors for all media after 2.1.0-beta.2 upgrade
Media folder: data/media
Filename: LohoTadjudinNewman.jpg

So, webtrees should look for the file data/media/LohoTadjudinNewman.jpg

> The data folder has 0777 permissions and is owned by root:wheel
> The media folder has 0750 permissions and is owned by root:wheel
> This particular filename is "LohoTadjudinNewman.jpg". It has 0644 permissions and is owned by root:wheel.

I'm assuming that your webserver isn't

* running as root
* running as a user in the group "wheel"

(Both of these would be a poor choice from a security perspective).

So, I guess that it cannot view the contents of data/media - hence you get a "file not found" / 404 error.

Either change the permissions so that your webserver can read the folder, or change the owner of the folder to match the webserver.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • nycvelo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago #14 by nycvelo

Media folder: data/media
Filename: LohoTadjudinNewman.jpg

So, webtrees should look for the file data/media/LohoTadjudinNewman.jpg

> The data folder has 0777 permissions and is owned by root:wheel
> The media folder has 0750 permissions and is owned by root:wheel
> This particular filename is "LohoTadjudinNewman.jpg". It has 0644 permissions and is owned by root:wheel.

I'm assuming that your webserver isn't

* running as root
* running as a user in the group "wheel"

(Both of these would be a poor choice from a security perspective).

So, I guess that it cannot view the contents of data/media - hence you get a "file not found" / 404 error.

Either change the permissions so that your webserver can read the folder, or change the owner of the folder to match the webserver.

In FreeBSD, the root user starts the Nginx process as root and then spawns subprocesses that run as user www.

But...this isn't a permissions problem. If it were, Nginx's error log would note that, and there are no entries to indicate a permissions issue.

Further, even after changing ownership of data/media and all files under it to www:www and then restarting Nginx, the 404 icons persist, again without Nginx's error logs showing a complaint. (Error logging is working; attempts to access a nonexistent page will generate a log entry.)

Even when owned by root:wheel, the media directory and all contents within are world-readable, and the media directory is world-executable.

This doesn't appear to be an issue of Nginx and permissions. This behavior began after an upgrade from webtrees 2.0.x and php7.3 to webtrees 2.1.x and php 8.0. Thanks in advance for future troubleshooting clues.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #15 by fisharebest
Replied by fisharebest on topic 404 errors for all media after 2.1.0-beta.2 upgrade
> The media folder has 0750 permissions and is owned by root:wheel

> In FreeBSD, the root user starts the Nginx process as root and then spawns subprocesses that run as user www.

So user www cannot read the media folder, and this would cause a 404 error...

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • nycvelo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago - 1 year 9 months ago #16 by nycvelo

> The media folder has 0750 permissions and is owned by root:wheel

> In FreeBSD, the root user starts the Nginx process as root and then spawns subprocesses that run as user www.
So user www cannot read the media folder, and this would cause a 404 error...

It's not a permissions issue. The directory and files are world-readable. And the issue persisted even after chown'ing the entire webtrees tree to be owned by www:www and rebooting.

What DID resolve this was clearing the browser cache (in my case, Brave, a Chrome derivative). A clue came from noticing that (a) Nginx never logged 404 errors and (b) Firefox and Safari browsers correctly displayed all images.

The root cause was the Brave browser's bad cache contents, completely unrelated to the server.

OK, upgrading to 2.1.5 now...
Last edit: 1 year 9 months ago by nycvelo.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}