Diferencia entre revisiones de «Drupal»

De gacq wiki
Saltar a: navegación, buscar
(Database error creating nodes)
(Database error creating nodes)
 
(No se muestran 2 ediciones intermedias del mismo usuario)
Línea 6: Línea 6:
 
== Database error creating nodes ==
 
== Database error creating nodes ==
  
Ocurred running drupal 6.4 using a database migrated from Drupal 5
+
Occurred running Drupal 6.4 using a database migrated from Drupal 5
  
 
The error:
 
The error:
Línea 15: Línea 15:
  
 
Apparently is produced by a problem during database upgrade, because auto_increment is not set for node_revisions table.
 
Apparently is produced by a problem during database upgrade, because auto_increment is not set for node_revisions table.
 +
 +
Check if 'vid' is PRIMARY KEY on 'node_revisions' and also check that is set to 'auto_increment'
  
 
===To fix===
 
===To fix===
Línea 23: Línea 25:
 
</pre>
 
</pre>
  
And sum 1 to the number obtained from previous query and replace YOUR_NUMBER with it.
+
And sum 1 to the number obtained from previous query and replace YOUR_NUMBER with it and run:
  
and run:
 
 
<pre>
 
<pre>
 
ALTER TABLE `node_revisions` ADD PRIMARY KEY ( `vid` )
 
ALTER TABLE `node_revisions` ADD PRIMARY KEY ( `vid` )

Revisión actual del 14:03 26 sep 2008

Documentation


Errores

Database error creating nodes

Occurred running Drupal 6.4 using a database migrated from Drupal 5

The error:

# user warning: Duplicate entry '0' for key 2 query: INSERT INTO node (vid, type, language, title, uid, status, created, changed, comment, promote, moderate, sticky, tnid, translate) VALUES (0, 'page', 'es', 'eee', 1, 1, 1222437644, 1222437644, 2, 1, 0, 0, 0, 0) in /var/www/webapps/drupal6/includes/common.inc on line 3318.
# user warning: Duplicate entry '0' for key 1 query: INSERT INTO node_comment_statistics (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (0, 1222437644, NULL, 1, 0) in /var/www/webapps/drupal6/modules/comment/comment.module on line 607.

Apparently is produced by a problem during database upgrade, because auto_increment is not set for node_revisions table.

Check if 'vid' is PRIMARY KEY on 'node_revisions' and also check that is set to 'auto_increment'

To fix

Obtain last node ID

SELECT max( nid ) FROM `node` 

And sum 1 to the number obtained from previous query and replace YOUR_NUMBER with it and run:

ALTER TABLE `node_revisions` ADD PRIMARY KEY ( `vid` )
ALTER TABLE `node_revisions` CHANGE `vid` `vid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT
ALTER TABLE `node` AUTO_INCREMENT=YOUR_NUMBER
ALTER TABLE `node_revisions` AUTO_INCREMENT=YOUR_NUMBER

Error en ejecucion de cron

From: root@otrasyerbas.com.ar (Cron Daemon)
To: www-data@otrasyerbas.com.ar
Subject: Cron <www-data@geacequ>          [ -x /usr/share/drupal/scripts/cron.sh ] && /usr/share/drupal/scripts/cron.sh

Fatal error: Call to undefined function:  mysql_connect() in /usr/share/drupal/includes/database.mysql.inc on line 31

El script del cron usa las extensiones de mysql de php4-cli que hay que habilitar editando /etc/php4/cli/php.ini y descomentando "extension=mysql.so"

Ejemplos Bloques

<?php
$uptime = shell_exec("cut -d. -f1 /proc/uptime");
$loadavg_array = explode(" ", exec("cat /proc/loadavg"));
$loadavg = $loadavg_array[2];
$days = floor($uptime/60/60/24);
$hours = $uptime/60/60%24;
$mins = $uptime/60%60;
$secs = $uptime%60;
echo "This server has been up $days day(s) $hours hour(s) $mins minute(s) and $secs second(s)";
echo "<p><br>";
print("[ Current server load: " . $loadavg . " ]");
?>