Skip to main content
Topic: Can't upload avatar nor post anything (Read 2821 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Can't upload avatar nor post anything

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...

Re: Can't upload avatar

Reply #1

As a quick thought, double check what you have entered for avatar directory and url

Re: Can't upload avatar

Reply #2

Looks alright.

Re: Can't upload avatar nor post anything

Reply #3

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?

Re: Can't upload avatar nor post anything

Reply #4

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.

Re: Can't upload avatar nor post anything

Reply #5

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.

Re: Can't upload avatar nor post anything

Reply #6

Mostly likely the attachmentUploadDir variable in the _settings table ... what is in there?

Re: Can't upload avatar nor post anything

Reply #7

You can also use repair_settings.php to fix url and path.

Re: Can't upload avatar nor post anything

Reply #8

@ahrasis I did directly after the upgrade. Everything seems to work but this.

@Spuds I will check it later, I am at work now.

Re: Can't upload avatar nor post anything

Reply #9

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.

Re: Can't upload avatar nor post anything

Reply #10

In /sources/ext/serialize.php change:
Code: [Select]
} catch(Exception $e) {
to:
Code: [Select]
} catch(\Exception $e) {

https://github.com/elkarte/Elkarte/issues/3192
Bugs creator.
Features destroyer.
Template killer.

Re: Can't upload avatar nor post anything

Reply #11

Sorry, same error message.  :(

Re: Can't upload avatar nor post anything

Reply #12

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.

Re: Can't upload avatar nor post anything

Reply #13

@Jorin  there are two instances of the code I suggested to replace, did you replace both of them?
Bugs creator.
Features destroyer.
Template killer.

Re: Can't upload avatar nor post anything

Reply #14

Oh, no, only the first... I will try to replace the second also later.