News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Custom avatars not being served, just generic (which are missing)

Started by mathx, September 19, 2022, 05:03:26 PM

Previous topic - Next topic

mathx

This topic is as old as a dead horse, but most >120 days. My problem seems unique. Apologies if redundant.

Custom avatars are not working. The /avatars and /attachments dirs didnt exist for some reason on upgrade from 2.0.x, so it was recopied from backup. No avatars/default.png either somehow (symlinked to Oxygen/invisible_user.png for now, works).

But default.png should not be every user's avatar - should be custom. SMF is serving up a 404 default.png, not a custom db-query-looking url which as I'd expect (Im new to SMF helping a less savvy forum operator, but i got lots of linux/debian experience).

This seems busted such that no db query is attempted to customize long-term users' avatars which def existed & worked under 2.0.x, now merely serving up default.png (busted til I hammered in the symlink).

I dont believe a repair_settings.png to fix a path sounds like the solution here (and I think he already ran it). Just reran with no love.

Small hints: a few users avatars work, but those are in the db as smf_member:avatar as full URLs. All others are blank. (one is a url that points back at the forum itself to /gallery/something and works fine - is that the usual format of a local avatar file? a self-pointing url into the gallery?)

Either way, how did these all get blanked? I can boot the old instance and extract whatever db values all users had for their avatars but this seems like a massive erasure of data via the upgrade tool.

Illori

the upgrade moves the users avatars to another folder, they were stored in the attachments folder. you need to restore your working 2.0.* forum and run the upgrade again with the attachments folder in place.

mathx

Course we did that in the first place, but avatars were not working after, thus me investigating. Too much other work has been done to fix the new install back to working to go back and reupgrade (plus many new posts in the boards now that they're half working). So there's no going back.

Where were avatars moved to, and why are db entries in smf_members avatar field blank? Where are custom avatars in the db if smf_members:avatar is blank?

Kindred

There's no reason that the upgrade would have blanked the dBase entries
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mathx

It seems not to have, I looked at an old copy I can boot - most users' avatar field is blank (except 10 of 350+ users with avatars). I went back a few weeks before the upgrade and see the same.

What's much more likely is I dont understand the table structures for SMF and not all avatars are necessarily stored in smf_members:avatar, but elsewhere. (Where?)

This thread came very close but just missed giving the answer by a hair: https://www.simplemachines.org/community/index.php?topic=281897.0

Uploading a new avatar works, I found it here

151502     21 -rw-r--r--   1 www-data www-data    19312 Sep 20 10:52 custom_avatar/avatar_647_1663685534.png

Now I assume that all the old avatars are in the attachments dir, but which are avatar files and which are not? Id need to query a table in the db to find out and manually move all those files into place into the custom_avatar dir.

I can see in smf_attachments attachment type 1 is for avatars, and querying for all matching attachments shows only one: my newly uploaded (and working) avatar. So I wont find old avatar filenames in there. :(

Please keep in mind as you read this was we *did the upgrade by the book* and since then we've started using the forum, too much to rollback. However, I can run mysql queries right off the cmd line through awk|sed|grep|cut|whatever to get a list of files to mv to the custom_avatars dir easily. Just need to know how to get the filenames to move from the db.

Sir Osis of Liver

In 2.0 all attachments and avatars are in /attachments directory, attachment filenames are hashed, avatars are not.  2.1 upgrade adds .dat extension to hash, and moves avatars to /custom_avatar.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

mathx

That's very helpful.

I am wondering how to determine in 2.0 where an avatar is in the db, if not in smf_members:avatar (that's only for external avatars, not uploaded or gallery). Then I can figure out which filename is where and either copy it over or move it to the right place. (And then figure out how they're structured in 2.1.2 in the db and ensure all that is properly setup..)

Sir Osis of Liver

Uploaded avatars are in _attachments table, same as attachments.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

mathx

yeah but how is it determined that a user's avatar to use is from that table and not a generic one or an external url?

and I need to know this for 2.0 as well so I can go find the old avatars on the old system. :P

Sir Osis of Liver

Don't have time to check right now, but there's an 'avatar' field in _members table, I believe generic and linked avatars are stored there.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kootch

Since he upgrade,

1.  when users try to add an avatar, it gives an error of timing out when they attempt to upload one in Profile Details.

2.  users custom avatars that were a part of the forum before the upgrade are not available as an option any longer.  Is there a quick fix I can do for that, and how?

Thanks!


Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kootch

Quote from: Sir Osis of Liver on September 28, 2022, 09:39:39 PMWhat's in /custom_avatar?

I'm not the most techie guy.  I don't seem to have a /custom_avatar directory when I look through FTP.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters


Sir Osis of Liver

A 2.1 install should have a /custom_avatar directory in forum root,  whether it was installed from scratch or upgraded from previous version.  If you don't see that directory then your forum is incomplete, and uploaded avatars will not work.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Quote from: Sir Osis of Liver on September 20, 2022, 06:32:38 PMIn 2.0 all attachments and avatars are in /attachments directory, attachment filenames are hashed, avatars are not.  2.1 upgrade adds .dat extension to hash, and moves avatars to /custom_avatar.

Just rereading this topic, your problem appeared after upgrading from 2.0.  If you don't have /custom_avatar directory, uploaded attachments should still be in /attachments directory, they're the files with unhashed filenames.  Members will be unable to upload avatars if the /custom_avatar directory is missing.  2.1 upgrader sometimes fails to rename attachments and/or move avatars from /attachments to new directory.   Recommended solution is to rerun upgrade, but if you're too far into 2.1 to do that without losing content, you can try fixing it manually by creating /custom_avatar and moving avatars into that directory.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kootch

Should I be creating that /custom_avatar in the root directory of the forum, or created inside the /avatars directory?

Kootch

Quote from: Kootch on September 29, 2022, 07:37:02 PMShould I be creating that /custom_avatar in the root directory of the forum, or created inside the /avatars directory?

I tried to create a /custom_avatar directory but it won't let me, via FTP. It's like there's one there, hidden or something?!  I'll go in via command line tomorrow when my head isn't pounding :)

Sir Osis of Liver

It's in the forum root.  If you have cpanel, try creating the directory with file manager.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: