Posts Tagged ‘error’

Concrete 5 SQL errors during installation

Friday, February 3rd, 2012

We have seen this error with Concrete 5.5.1

You try to setup Concrete 5, and get strange SQL errors during the installation:

If installing with an empty site, like this

c5-nosample-content-chosen

you get:

c5-mysql-error

mysql error: [1048: Column 'uID' cannot be null] in EXECUTE("INSERT INTO Config (cfKey,cfValue,uID) VALUES ('NEWSFLOW_LAST_VIEWED','FIRSTRUN',NULL)")

If installing with Sample content with Blog:

c5 with sample content

The error you get is:

Catchable fatal error: Argument 1 passed to ContentImporter::importPageAreas() must be an instance of Page, boolean given, called in /concrete/libraries/content/importer.php on line 75 and defined in /concrete/libraries/content/importer.php on line 197.

 

Solution:

You don't run Varnish by any chance, do you? We do, and we had it set up to … dispose of some cookies. The solution is, in Varnish' case, to enable pass-through for the host you are installing on.

You want to enable cookies.

 

Explanation:

The code which breaks is located in concrete5.5.1\concrete\models\package\starting_point.php

Config::save('SITE', SITE);
Config::save('SITE_APP_VERSION', APP_VERSION);
$u = new User();
$u->saveConfig('NEWSFLOW_LAST_VIEWED', 'FIRSTRUN');

As you see, this is the first time a User is created and used.

The User class is defined in concrete5.5.1\concrete\models\user.php

if (isset($_SESSION['uID'])) {
$this->uID = $_SESSION['uID'];
$this->uName = $_SESSION['uName'];
$this->uTimezone = $_SESSION['uTimezone'];
if (isset($_SESSION['uDefaultLanguage'])) {
$this->uDefaultLanguage = $_SESSION['uDefaultLanguage'];
}
$this->superUser = ($_SESSION['uID'] == USER_SUPER_ID) ? true : false;
} else {
$this->uID = null;
$this->uName = null;
$this->superUser = false;
$this->uDefaultLanguage = null;
$this->uTimezone = null;
}
$this->uGroups = $this->_getUserGroups();
if (!isset($args[2])) {
$_SESSION['uGroups'] = $this->uGroups;
}
}

The constructor checks in the Session for a valid user ID. If no user ID is found, it is set to zero. This happens if you throw away the cookies! Because the session is stored in them.

HTH. Feel free to comment on similar errors and solutions.

Zimbra upgrade without tears

Sunday, January 23rd, 2011

The Zimbra installer uses an utility script to find out your distro and release:

/bin/get_plat_tag.sh

And the output of this determines which prerequisites the installer expects. This list of prerequisites is coded in

/util/utilfunc.sh

(search for "UBUNTU8" for instance)

In some cases, as in mine, this get_plat_tag.sh script may not detect your distro and/or version correctly which may lead to screw-ups with required prerequisites. You may want to use this dirty hack to solve the problem: modify the get_plat_tag.sh script at the very beginning to echo the distro and release you want (actually need) it to echo by inserting:

#quickfix
echo "DEBIAN5_64"
exit 0

You may find yourself running into missing requirements, in my case it was MISSING: libgmp3 – although I can't install this package (I have to use libgmp3c2 which was already installed and is the correct requirement for other distros). After setting the correct distro and release the installation was without problems!

Windows 7 Hibernation Problems

Monday, November 22nd, 2010

When I run cmd.exe as Admin ("elevated command prompt"), and enter

powercfg -h on

I get this error: "The system could not create the hibernation file. The specific error code is 0xc0000043."

Outlook Express Timeouts

Monday, August 30th, 2010

Obwohl Outlook Express bereits auf die maximale Wartezeit eingestellt ist, kommt es trotzdem bei manchen zu Timeout-Problomen.

(Original-Text auf italienisch: "il server ha interrotto la connessione in modo inatteso. …" = "Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Account: 'account name', Server:'server', Protocol: POP3, Port 110, Secure (SSL); No, Error Number: 0x800CCC0F"

Eine Recherche bringt folgende Möglichkeiten zustande:

  • Outlook Express hat einen Bug, was bei bestimmten e-Mails (mit leerer Message-ID) zu Timeouts führt bzw. dazu, dass eine Mail immer und immer wieder geholt wird. Siehe dazu diesen Artikel.
  • Norton AntiVirus scannt einkommende UND abgehende Mails. Norton's Support schlägt vor, den Scan abzuschalten um das Problem zu lösen.
    Hier ist ein weiterer Artikel mit Überblick über Norton, McAffee, Trend-Micro.
  • Falls wir einen Exchange Server betreiben würden, hätte Microsoft auch einen Lösungsvorschlag.
  • Manchmal ist bei Outlook Express eingestellt, dass es die Internetverbindung automatisch trennen soll. Bell hat dazu eine Seite (auf Englisch).

Concrete5 errors

Wednesday, March 31st, 2010

Fatal error: Class 'CollectionAttributeKey' not found in (…)/concrete/models/collection.php on line 183

This class is defined in concrete5.3.3.1\concrete\models\attribute\categories\collection.php

The problem is easily resolved by loading the appropriate model in your code:

Loader::model('attribute/categories/collection');

Russian and Chinese editing with Concrete 5

Sunday, March 21st, 2010

concrete multi language

It is not enough to add a Character set to your Template // or store it in UTF-8 without BOM (so the headers attached by PHP won't break).

If TinyMCE only displays gibberish instead of the Russian / Chinese / … text you entered in edit mode, you should edit your .htaccess (located in the root directory of your site) and add the following:

AddDefaultCharset UTF-8

Optionally, while you're at it, you can enable caching for your site:

#Speed UP!
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 10 years"
ExpiresByType text/html "access plus 30 seconds"
</IfModule>

MySQL

Thursday, February 25th, 2010

[25-Feb-2010 16:15:46] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in … on line 38
[25-Feb-2010 16:15:46] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in … on line 38
(…)

Lösung des Problems:
die Funktion mysql-real-escape-string erfordert eigentlich zwei Parameter: zuerst den $unescaped_string, dann die resource $link_identifier. Lässt man zweiteres weg, versucht MySQL die aktuell zuletzt geöffnete Verbindung zu benutzen.

Ich habe in meinem Skript den Zugang zur Datenbank erst danach geöffnet. (Das ist der wichtigste Unterschied zwischen mysql_escape_string und mysql_real_escape_string – ersteres erfordert KEINEN Zugriff auf die Datenbank!)