Error Log

Started by DADsFME, December 31, 2014, 06:13:59 AM

Previous topic - Next topic

DADsFME

Anyone getting loads of errors?

Over the period of a few days I'm getting literally thousands of errors popping up mostly to do with cron.php and Display.php.  It's a brand new setup starting with a completely blank database and the full install of SMF 2.1 Beta

Typical logs are:

Display.php
Line: 1372

Type of error: Undefined
8: Undefined index: member


and......


File: /home/****/********/**********/public_html/Sources/tasks/CreatePost-Notify.php
Line: 62

Type of error: Cron
8: unserialize(): Error at offset 99 of 390 bytes
http://*************/cron.php

Thanks :)

Arantor

Error at offset implies invalid data got into the database. I would wonder how this happened, did you or someone else make a post with iPhone emoji in it or something?

As for the other error... interesting, never seen that before.

DADsFME

Quote from: Arantor on December 31, 2014, 06:15:54 AM
Error at offset implies invalid data got into the database. I would wonder how this happened, did you or someone else make a post with iPhone emoji in it or something?


That's possible, I'll take a look.

Arantor

I would be slightly surprised if you found it to be honest since it would get trashed by the database but the serialize() operation would be confused.

If you could pull the data from the background tasks table, we could have a look at it to see if that's what happened.

DADsFME

Typical CRON.php Errors.....

LINE ==>199:    

$details = empty($task_details['task_data']) ? array() : unserialize($task_details['task_data']);

LINE ==>62:    
   
);


Display.php errors......


LINE ==>1372:    
   

$memberContext[$message['id_member']]['show_email'] |= ($message['id_member'] == $context['member']['id']);

Arantor

I wasn't asking about the code on those lines of the *files* because in the case of the cron code... I'm the one who wrote it. The database content is damaged, I need to see the database content.

As for the Display code, I suspect that should be $context['user']['id'] not $context['member']['id'].

DADsFME

Would an SQL dump of the background tasks table be sufficient?

Arantor

Yes, that's pretty much what I was asking for.

DADsFME

#8
OK cheers.....


-- phpMyAdmin SQL Dump
-- version 4.2.12
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 31, 2014 at 12:56 PM
-- Server version: 5.5.40-0+wheezy1
-- PHP Version: 5.4.35-0+deb7u2

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `dadsfme`
--

-- --------------------------------------------------------

--
-- Table structure for table `smf_background_tasks`
--

CREATE TABLE IF NOT EXISTS `smf_background_tasks` (
`id_task` int(10) unsigned NOT NULL,
  `task_file` varchar(255) NOT NULL DEFAULT '',
  `task_class` varchar(255) NOT NULL DEFAULT '',
  `task_data` mediumtext NOT NULL,
  `claimed_time` int(10) unsigned NOT NULL DEFAULT '0'
) ENGINE=MyISAM AUTO_INCREMENT=877 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `smf_background_tasks`
--

INSERT INTO `smf_background_tasks` (`id_task`, `task_file`, `task_class`, `task_data`, `claimed_time`) VALUES
(557, '$sourcedir/tasks/CreatePost-Notify.php', 'CreatePost_Notify_Background', 'a:4:{s:10:"msgOptions";a:9:{s:2:"id";i:383;s:7:"subject";s:21:"Re: Amber on a Tablet";s:4:"body";s:290:"[quote author=altharic link=msg=382 date=1418255122]<br>On board sound will do that updated drivers?<br>[/quote]yeah might get around to that at some point.&nbsp; Its playable but annoying that the touch screen doesnt work like you'd expect it to.<br><br>still experimenting though ', 1420026808);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `smf_background_tasks`
--
ALTER TABLE `smf_background_tasks`
ADD PRIMARY KEY (`id_task`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `smf_background_tasks`
--
ALTER TABLE `smf_background_tasks`
MODIFY `id_task` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=877;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Arantor

So, yeah, what's happened is the serialized string says it was expecting 290 bytes, and got 281 - because something after the word 'though' at the end got cut off. My bet is that it's something like an iPhone emoji.

This is discussed in https://github.com/SimpleMachines/SMF2.1/issues/2162 and requires a fix in the core of SMF to actually deal with. It is a non trivial thing to fix, sadly.

DADsFME

Quote from: Arantor on December 31, 2014, 08:16:32 AM
So, yeah, what's happened is the serialized string says it was expecting 290 bytes, and got 281 - because something after the word 'though' at the end got cut off. My bet is that it's something like an iPhone emoji.

This is discussed in https://github.com/SimpleMachines/SMF2.1/issues/2162 [nofollow] and requires a fix in the core of SMF to actually deal with. It is a non trivial thing to fix, sadly.
Ah OK

I made that post and whilst I do have an Iphone I didn't post the message using it nor did it contain a emoji AFAIK.  I'll just live with the problems for now although Its just a bit annoying that I have to empty the error log every so often lol   

Thanks very much for the time taken to look into it though, its much appreciated.

Kindred

do please use CODE BBC tags when you paste things like that, though....


You can always edit the SQL column/field directly to fix the error
Сл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."

Arantor

Actually in this case I doubt you can. Editing serialized data by hand is a fragile process at best. Especially since part of it is *missing* because it was truncated by the database since a 4-byte UTF-8 character was inserted which will be discarded by MySQL's standard UTF-8 fields (which are only 3 byte fields)

At some stage this will need to be fixed in SMF core. I know I've spoken to Oldiesmann about a possible way of fixing this in the past.

Antechinus

Couldn't you just edit the offending post in the forum itself, and fix the db that way?

Arantor

Not in this case. The background task is generated when the post is created (to send out notifications), editing doesn't generate a new background task, nor would it edit an existing one.

Advertisement: