ElkArte Community

Project Support => Support => Topic started by: Jorin on May 27, 2018, 07:40:06 am

Title: Can't upload avatar nor post anything
Post by: Jorin on May 27, 2018, 07:40:06 am
I upgraded from 1.0.10 to 1.1.2 and now updated to 1.1.3. I can't upload any avatar, I get the message:

Code: [Select]
safe_unserialize: unknown/malformed type: /

No avatar, even old ones, is shown anymore since the upgrade. Can anyone help?

Edit: Same error appears when trying to post...
Title: Re: Can't upload avatar
Post by: Spuds on May 27, 2018, 08:44:17 am
As a quick thought, double check what you have entered for avatar directory and url
Title: Re: Can't upload avatar
Post by: Jorin on May 27, 2018, 08:54:12 am
Looks alright.
Title: Re: Can't upload avatar nor post anything
Post by: Jorin on May 27, 2018, 10:17:52 am
Oops, the same error appears when I try to post something.  :o

Edit: Strange is, in mobile view avatars are there and I can post, but not in desktop view.  :o  Something with my css?
Title: Re: Can't upload avatar nor post anything
Post by: Spuds on May 27, 2018, 10:41:03 am
It should not be your css ... unserilaize is mostly used to unpack values stored in $modSettings  The \ seemed like a path item which is why I said to double check the avatar thing.

Since you are in maintenance mode, can you edit the file sources/ext/serialize.php
Code: (find) [Select]
			throw new \Exception('safe_unserialize: unknown/malformed type: '.$type);
Code: (replace) [Select]
			throw new \Exception('safe_unserialize: unknown/malformed type: '.$type.' string: '.$str);
so we can see the value that its failing on .. that may give us an idea of where in the ACP to look.
Title: Re: Can't upload avatar nor post anything
Post by: Jorin on May 27, 2018, 11:53:35 am
Code: [Select]
safe_unserialize: unknown/malformed type: / string: /www/htdocs/xyz/hp_elkarte/attachments

Okay, it has to do with the attachments or avatars, it seems. I can't open the attachments settings inside ACP because of the error message. I only can open the avatar settings page. What I can is access the database itself and look (and edit) paths there.
Title: Re: Can't upload avatar nor post anything
Post by: Spuds on May 27, 2018, 12:15:09 pm
Mostly likely the attachmentUploadDir variable in the _settings table ... what is in there?
Title: Re: Can't upload avatar nor post anything
Post by: ahrasis on May 28, 2018, 12:04:49 am
You can also use repair_settings.php to fix url and path.
Title: Re: Can't upload avatar nor post anything
Post by: Jorin on May 28, 2018, 02:28:30 am
@ahrasis I did directly after the upgrade. Everything seems to work but this.

@Spuds I will check it later, I am at work now.
Title: Re: Can't upload avatar nor post anything
Post by: Jorin on May 28, 2018, 06:30:38 am
Quote from: Spuds – Mostly likely the attachmentUploadDir variable in the _settings table ... what is in there?

Code: [Select]
/www/htdocs/xyz/hp_elkarte/attachments

Looks correct.

Also:

Code: [Select]
avatar_directory: /www/htdocs/xyz/hp_elkarte/avatars
avatar_url: https://forum-alternative-antriebe.de/avatars

Looks good too.
Title: Re: Can't upload avatar nor post anything
Post by: emanuele on May 28, 2018, 07:19:54 am
In /sources/ext/serialize.php change:
Code: [Select]
} catch(Exception $e) {
to:
Code: [Select]
} catch(\Exception $e) {

https://github.com/elkarte/Elkarte/issues/3192
Title: Re: Can't upload avatar nor post anything
Post by: Jorin on May 28, 2018, 08:32:52 am
Sorry, same error message.  :(
Title: Re: Can't upload avatar nor post anything
Post by: Spuds on May 28, 2018, 09:08:13 am
Humm and Humm ... well if that is whats in there, its not going to unserialized since its not serialized to start with. 

I'm not sure if thats an upgrade issue or another bug.  Change the value in your db to be

Code: [Select]
a:1:{i:1;s:38:"/www/htdocs/xyz/hp_elkarte/attachments";}
and is should stop the error being thrown, but we still need to figure out why its trying to unserialize a string value

the s:38 is the exact number of characters ... so when you enter the real value instead of xyz , you need to adjust that up/down as needed.
Title: Re: Can't upload avatar nor post anything
Post by: emanuele on May 28, 2018, 10:21:37 am
@Jorin  there are two instances of the code I suggested to replace, did you replace both of them?
Title: Re: Can't upload avatar nor post anything
Post by: Jorin on May 28, 2018, 10:30:20 am
Oh, no, only the first... I will try to replace the second also later.
Title: Re: Can't upload avatar nor post anything
Post by: Jorin on May 28, 2018, 12:04:49 pm
My upload directory in the ACP attachments settings is missing! How's that even possible during an upgrade? I fixed this and changed the two codes back to:

Code: [Select]
} catch(Exception $e) {

...and now I can post again and change my avatar. Seems okay now.

Thanks for your help!
Title: Re: Can't upload avatar nor post anything
Post by: emanuele on May 28, 2018, 02:48:39 pm
Let's  see if it works. O:-)