29-Nov-2008

PHP problem – revisited
The error shows does show where it occurs and I took a look:

function _mb_strcut( $str, $start, $length=null, $encoding=null ) {
// the solution below, works only for utf-8, so in case of a different
// charset, just use built-in substr
$charset = get_option( 'blog_charset' );
if ( !in_array( $charset, array('utf8', 'utf-8', 'UTF8', 'UTF-8') ) ) {
return is_null( $length )? substr( $str, $start ) : substr( $str, $start, $length);
}
// use the regex unicode support to separate the UTF-8 characters into an array
preg_match_all( '/./us', $str, $match );
$chars = is_null( $length )? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
return implode( '', $chars );
}

The second part are the lines causing trouble:

94 preg_match_all( ‘/./us’, $str, $match );
95 $chars = is_null( $length )? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
96 return implode( ”, $chars );

These lines are called if the line in the OPTIONS table that carries BLOG_CHARSET, specified UTF-8. Which is the case….
After changing this to CP850 – the old Windows code page – these errors do no longer appear, but other porblems arise: It’s not possible to add an image. The three choises: Choose/Upload, Gallery and Media Library show up, but in the Gallary tab, the ‘show’ link that should come up with the properties is not displayed, IE 7 however mentions an error:
Line: 4
Char: 1
Error: Object doesn't support this property or Method
Code: 0
URL: https://(Site)/(blog)/wp-admin/media-upload.php?type=image&tab=gallery&post_id=7

In the media Library tab, ‘show’ does work but the Insert button does not return to the post. The screen is empty but some code has been sent to the browser:

<script type="text/javascript">
/* <![CDATA[ */
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor('<a
href=\"https://(site)/(blog)/wp-content/uploads/2008/11/ff1.jpg\"><img
src=\"https://(site)/(blog)/wp-content/uploads/2008/11/ff1.jpg\"
alt=\"\" title=\"ff1\" width=\"140\" height=\"24\" class=\"alignleft
size-medium wp-image-9\" /></a>');
/* ]]> */
</script>

So adding an image still doesn’t work
Francesco didn’t run into this – I think he just uploaded files (which I haven’t retried yet) but he ran into another issue, when he supplies a caption:

Warning: Compilation failed: this version of PCRE is not compiled with
PCRE_UTF8 support at offset 0 in
/wordpress_ist_provablog/wp-includes/shortcodes.php on line 213

I looked into this code and found:

function shortcode_parse_atts($text) {
$atts = array();
$pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\
$text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {

line 213 is the line:

$text = preg_replace(“/[\x{00a0}\x{200b}]+/u”, ” “, $text);

preg_replace is, like preg_match_all, array_slice and implode a basic PHP funtion, part of the PCRE module. Since the code is still available on Diana, I could de a search:

$ sea php_root:[000000...]*.c preg_match_all,array_slice,implode,preg_replace

******************************
PHP_ROOT:[000000.ext.pcre]php_pcre.c;1

#define PREG_REPLACE_EVAL (1< <0) case 'e': poptions |= PREG_REPLACE_EVAL; break; /* {{{ proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]]) PHP_FUNCTION(preg_match_all) eval = preg_options & PREG_REPLACE_EVAL; /* {{{ preg_replace_impl static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callable_replace) /* {{{ proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit]) PHP_FUNCTION(preg_replace) preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); /* {{{ proto string preg_replace_callback(mixed regex, mixed callback, mixed subject [, int limit]) PHP_FUNCTION(preg_replace_callback) preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); PHP_FE(preg_match_all, third_arg_force_ref) PHP_FE(preg_replace, NULL) PHP_FE(preg_replace_callback, NULL) ****************************** PHP_ROOT:[000000.ext.standard]array.c;2 /* {{{ proto array array_slice(array input, int offset [, int length]) PHP_FUNCTION(array_slice) ****************************** PHP_ROOT:[000000.ext.standard]basic_functions.c;2 PHP_FE(implode, NULL) PHP_FALIAS(join, implode, NULL ) PHP_FE(array_slice, NULL) ****************************** PHP_ROOT:[000000.ext.standard]string.c;2 An alias for implode */ /* {{{ php_implode PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value) /* {{{ proto string implode([string glue,] array pieces) PHP_FUNCTION(implode) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument to implode must be an array."); php_implode(delim, arr, return_value); $

So I doubt there is no alternative as to reverse to a previous version of WP that didn't have these problems (like 2.6) or change the PHP code to bypass the problem...

WP update
WP 2.6.5 has been released - to bypass a bogus 2.6.4 that seems to float on the Internet, that version is bypassed. It will be installed soon.

28-nov-2008

Upload fails
Triggered by a message in the WASD mailing list, I tried what was said to fail: Uploading an image. Well, the upload itself is fine, but linking it to a post fails:

Warning: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in /sysblog/wp-includes/compat.php on line 94

Warning: array_slice(): The first argument should be an array in /sysblog/wp-includes/compat.php on line 95

Warning: implode(): Bad arguments. in /sysblog/wp-includes/compat.php on line 96

The file IS uploaded, but linking it ot the post doesn’t work. At least, embedding the image into the post does not work as before. The same error occurs in the Gallery and Media Libary selection panels, so there is no way linking an image directly into the post. Weird, though, that using the Media Library tab under Manage has no porblem at all, showing the images. That shows a permalink to the image itself – and that’s not a problem.

This issue was introduced, it seems, in 2.6.3.

It must be someting that causes a problem either in PHP or in the database. I’ll put a question in the WP forums.

Earlier posts still work without a problem, it’s just the addition into the post that gives trouble. As a workaround, you can always add is manually, like:

<a href='http://(site)/(blogdir)/wp-content/uploads/(yyyy)/(mm)/(image).png' title='(title)'><img src='http://(site)/(blogdir)/wp-content/uploads/(yyyy)/(mm)/(imagefile)' alt='(title)' /></a>.

As an example, similar code was copied from an earlier post and added in here:

Example of manually added image

This should have been done by the PHP code, that fails.

23-nov-2008

Podcasts
Podcasts – Ipod Broadcast – have been a request by Francesco Gennai. What he would like is streamed content: similar to youTube, though his example was more serious in the subjects offered. Live streaming will be a problem on OpenVMS since the IO system doesn’t support it, not the way that is required. But streaming files to a browser should be possible, so “Canned content”. I like Mark’s expression :).
So I set up a small environment, put some files to be retrieved, and created a small, very basic HTML file to access the files. These are indeed retrieved – but not in streaming mode. Not in the ususal set-up of the webserver, anyway.
So I followed a recommendation, by Robert Atkinson, to give podcastgen a try. For security reasons, I started to try it out on the secured site, but that implies a few problems I haven’t solved yet. You can read on the configuration and the problems on the podcast entry on the VMS wiki . and in the WASD mailing list archives – whenever my comments are accepted (it may lead to a problem – the Spam filter did complain for a number of reasons).

but once the problems are solved, there might be streaming video from this site, one day 🙂

16-Nov-2008

Hardware problems
Due to electricity work this morning, Diana has been switched off nicely – to prevent possible problems on startup. Just a few minutes, not to bother about too much.
Well, so I thought, but it turned out that the whole excersise in getting everyting back online was a very, very different matter: to put it simple: Diana refused to come alive. power on was no problem but in the line of starting, everything froze. I’ve had the problem before and cycling power several times usually helped, but not today.
So I had to boot another Alpha off the system disk. The easiest – and probably fastest – way was to take the AlphaServer 400 – it has 160 Mb internal memory, and carries an EV4 processor running at only 233 Mz – slow, compared to the Personal Workstation but it should do for DHCP, DNS, basic mail (including PMAS – the spam filter) and the basic, static webpages. After having replaced some cards – including the one that connects to the Shared SCSI bus, I booted this machine minimal, changed some startup files to prevent starting unneeded stuff, and restarted. It hung – but interrupting on the console and boot worked. The system started nicely, though slow. Once running I could disable the links to the blogs and the wiki in the page header – I had to extract the data from the library, change it and put it back in – and could create a text file to show.
The system ran nicely for a couple of hours, I could finish the job I was working on,, examione what was wrong with the Personal Workstation (now I had DNS, I could access the Internet 🙂 ) , and after that, I tried to retrieve my mail.
I shouldn’t have done that.
For some reason, the AlphaServer froze. Login to the AlphaServer failed – only CTRL-P worked. I initiated a system crash but that didn’t finish – and the SRM dumped it’s contents. Something I’ve seen happening when booting the box on shared SCSI when the PWS already booted from it.
At that time, I had been working finding out what went wrong in the PWS. The documentation I could find showed the problem was related to memory. At some point, the PWS beeped: once, three times, three times. The doc stated: there is no memory, or if there is, something made it unavailable. Re-seating the DIMMs seemed to help, but it took several attempts to have the system come up without a problem.
Once the AS400 got stuck, I added a KZPSA card – seemed to be required to get the Shared SCSI to life. But the console has some trouble with it, the startup sequence mentioned an error at test E6: Command error 4; and error happened after test E4 as well: SIMPORT failed.
So back to KZPBA – one left so put that is. Hooking it up the shared SCSI however didn’t work. For one reason or the other, this card didn’t notice the disks. Perhaps the wrong SCSI-Id? Changed that, to no avail. Finally, I re=installed the original cards in the PWS and the AS400 – hooked them up to the system and rebooted the PWS: And all seems well, at the moment.
The lesson: It’s time to get a newer box. Power off the PWS may become a nasty problem – once down, it may not come back again. But for now , it works.
Database trouble
I found this error in the database log:
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
081108 22:25:14 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 3274, file name ./mysql-bin.000013
081108 22:25:23 InnoDB: Started; log sequence number 0 502105172
081108 22:25:23 [Note] Recovering after a crash using mysql-bin
081108 22:25:23 [Note] Starting crash recovery...
081108 22:25:23 [Note] Crash recovery finished.
081108 22:25:25 [ERROR] Column count of mysql.db is wrong. Expected 22, found 15. The table is probably corrupted
081108 22:25:25 [ERROR] mysql.user has no `Event_priv` column at position 29
081108 22:25:25 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
081108 22:25:25 [Note] /$116$DKA100/000000/WEB/MYSQL/MYSQL051/VMS/bin/mysqld.exe: ready for connections.
Version: '5.1.23-rc-log' socket: '' port: 3306 Source distribution

and yet, everyting seems fine. I asked JEan-François about this, he suggested to do a check – it might be the result of the known problem with MyISAM – used by the MySQL engine itself. By mysqlcheck didn’t reveal anything worng. All tablwe were fine. But I might have missed something in upgrading the database, so that’s what I’ll do next – after making a backup 🙂
Update
It looks like it all worked, the conversion is done and all seems to be present. Here, at least. And a number of columns have been added to table mysql.db. Now time to restart MySQL and seen what the logfiles says:

$ type mysql051_root:[mysql_server]MYSQLD.LOG
$ Set NoOn
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
081116 22:32:07 InnoDB: Started; log sequence number 0 579383835
081116 22:32:08 [Note] Event Scheduler: Loaded 0 events
081116 22:32:08 [Note] /$116$DKA100/000000/WEB/MYSQL/MYSQL051/VMS/bin/mysqld.exe: ready for connections.
Version: '5.1.23-rc-log' socket: '' port: 3306 Source distribution
081116 22:32:08 [Note] Event Scheduler: scheduler thread started with id 1
$

I guess that’s more like it should be.

12-Nov-2008

Crash ?

This morning, about 12:00, all webs stopped responding, and any access resulted in a “Server not found” reply in the browser.

being off-site for today and tomorrow, it is not possible to get back soon enough. So I phoned home and found Kasper able to restart Diana and it seems all came up smoothly. Before, on my request, he had switched the console terminal on (to save power, it’s usually switched off) but the screen remained blank; the lights on the keyboard didn’t flash, and moving the mouse made no difference either. 

No error lights on the disks either. Just the power units and the controller – the latter flashing but that’s normal. 

Clearly something caused Diana to hang.  Now it’s a matter of waiting until tonight to find out what happened…

Well, wherever I looked, there is no appearant reason why the system ceased to respond. it must have been some time after 11;52, that’s the last time stamp I could find in any log file. Checking the error log, there I found the latest time stamp; but no clue on an error that might have caused the hang. Nor does operator.log, none of the running services mentions a problem. Checking accounting showed the system has run a bit longer:

     Date / Time      Type     Subtype     Username      ID     Source   Status
--------------------------------------------------------------------------------
12-NOV-2008 11:53:44 PROCESS INTERACTIVE HTTP$NOBODY  20200A40 MBA154: 00002BD4
12-NOV-2008 11:53:47 PROCESS INTERACTIVE HTTP$NOBODY  20200A41 MBA159: 00002BD4
12-NOV-2008 11:56:39 PROCESS INTERACTIVE HTTP$NOBODY  20200A52 MBA164: 00002BD4
12-NOV-2008 11:57:00 PROCESS BATCH       SYSTEM       20200A53         10030001

You could speculate that this batch process caused a problem, but that’s quite unlikely:

BATCH Process Termination
-------------------------
Username:          SYSTEM            UIC:               [SYSTEM]
Account:           SYSTEM            Finish time:       12-NOV-2008 11:57:00.15
Process ID:        20200A53          Start time:        12-NOV-2008 11:57:00.00
Owner ID:                            Elapsed time:                0 00:00:00.14
Terminal name:                       Processor time:              0 00:00:00.10
Remote node addr:                    Priority:          3
Remote node name:                    Privilege <31-00>: FFFFFFFF
Remote ID:                           Privilege <63-32>: FFFFFFFF
Remote full name:
Posix UID:         -2                Posix GID:         -2 (%XFFFFFFFE)
Queue entry:       194               Final status code: 10030001
Queue name:        NORMAL
Job name:          Mysql_watch
Final status text: %CLI-S-NORMAL, normal successful completion
Page faults:              315        Direct IO:                 41
Page fault reads:          47        Buffered IO:               59
Peak working set:        2704        Volumes mounted:            0
Peak page file:        173104        Images executed:            5

This job has run – unaltered – every 15 minutes for months so it’s unlikely it has caused an issue here.
The other jobs were simply FORCED_DELETE signals – the jobs being stopped by the webserver. Very common as well, so not likely to have caused the hang…
Audit has just one record between 11:15 and 14:00: the initialization of the audit server:
12-NOV-2008 13:53:36.67 AUDIT      AUDIT_INITIATE   DIANA  SYSTEM       20200105
So what has been the reason to hang, cannot be found….At least, I’m out of options.
Well, it did startup again, and as it seems, without a problem. That’s important as well.