Hi everyone,
Im hoping someone maybe able to help me with this. I have been using modx for sometime now without any problems at all but this morning i noticed an error on the site, the errors i see are below;
Warning: Invalid argument supplied for foreach() in /home/.../core/model/modx/modcontext.class.php on line 49
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/.../core/model/modx/modx.class.php on line 2621
Fatal error: Class ’modUser_’ not found in /home/.../core/xpdo/xpdo.class.php on line 537
I cant get into the manager as i receive the same errors. I have read a few threads that relate to this that say clear out the cache but how can i try this if i cant get into the back end? Does anyone have any suggestions on how i can fix this. Any advice will be highly appreciated.
Thanks in advace.
Hi everyone,
I just wanted to give some more information regarding this error, i temporarily remove the IF statement "from line 49" below which was on modcontext.class.php
40 public function prepare($regenerate= false) {
41 $prepared= false;
42 if ($this->config === null || $regenerate) {
43 if ($this->xpdo->getCacheManager()) {
44 $context = array();
45 if ($regenerate || !($context = $this->xpdo->cacheManager->get($this->getCacheKey()))) {
46 $context = $this->xpdo->cacheManager->generateContext($this->get(’key’));
47 }
48 if (!empty($context)) {
49 foreach ($context as $var => $val) {
$this->$var = $val;
}
$prepared= true;
}
}
By doing this i can see the home page but i cant get into the manager login page. When i go to manager i just see a white blank page. Can any help in getting this back to normal. Any advice will be highly appreciated.
Thanks
-
MODX Staff
- 10,725 Posts
Someone changed something, either in your hosting configuration or the site definition. I suspect it was a PHP upgrade that broke something. Perhaps they added eAccelerator or APC or something which is breaking the functionality.
Hi OpenGeek,
Thanks for the fast reply, I contacted the hosting company today and they told me that there hasnt been any changes of any kind to the server. This is driving me mad.
I have looked at the log files and the last error message says I have duplicate entries, does this mean anything to you? I have pasted it below;
[2010-11-12 15:48:41] (ERROR @ /joe/manager/index.php) Error 23000 executing statement:
INSERT INTO `joedb_register_messages` (`topic`, `id`, `created`, `valid`, `accesses`, `expires`, `payload`, `kill`) VALUES (’1’, ’******ff062936a96d3c8bd1f******’, ’2010-11-12 15:48:41’, ’2010-11-12 15:48:41’, ’0’, ’***9577***’, ’if (time() > ***9577***) return null;\nreturn 1;\n’, ’0’)
Array
(
[ 0 ] => 23000
[1] => 1062
[2] => Duplicate entry ’1-******ff062936a96d3c8bd1f******’ for key 1
)
[2010-11-12 15:48:41] (ERROR @ /joe/manager/index.php) Could not send message to queue 1, topic /resource/. Message payload is Array
(
[-******ff062936a96d3c8bd1f******] => 1
)
/resource/index.php) Could not cache context settings for mgr.
After this all error messages are roughly the same
[2010-11-12 18:30:42] (ERROR @ /index.php) Error caching resource 50
[2010-11-12 19:28:28] (ERROR @ /index.php) Error caching resource 1
[2010-11-12 19:51:43] (ERROR @ /joe /connectors/resource/index.php) Could not cache context settings for mgr.
[2010-11-12 19:51:44] (ERROR @ /joe /connectors/resource/index.php) Error caching lexicon topic lexicon/en/core/default
[2010-11-12 19:51:44] (ERROR @ /joe /connectors/resource/index.php) Error caching action map mgr/actions
[2010-11-12 19:51:44] (ERROR @ /joe /connectors/resource/index.php) Error caching lexicon topic lexicon/en/core/resource
[2010-11-12 19:51:44] (ERROR @ /joe/connectors/resource/index.php) Could not cache context settings for web.
[2010-11-13 14:30:43] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:30:44] (ERROR @ /../../../.com/.. /htdocs/ joe /core/model/modx/modx.class.php : 488) PHP warning: Invalid argument supplied for foreach()
[2010-11-13 14:30:44] (ERROR @ /../../../.com/.. /htdocs/ joe /core/model/modx/modx.class.php : 488) PHP warning: Invalid argument supplied for foreach()
[2010-11-13 14:31:11] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:31:53] (ERROR @ /joe/manager/index.php) Could not load context: mgr
[2010-11-13 14:31:53] (ERROR @ / joe /manager/index.php) Could not load context: mgr
[2010-11-13 14:41:22] (ERROR @ / joe /manager/index.php) Could not load context: mgr
[2010-11-13 14:41:26] (ERROR @ / joe /manager/index.php) Could not load context: mgr
[2010-11-13 14:41:31] (ERROR @ / joe /manager/index.php) Could not load context: mgr
[2010-11-13 14:42:49] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:44:50] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:44:55] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:45:12] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:45:15] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:45:19] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:45:22] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:45:25] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:46:03] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:46:21] (ERROR @ / joe /manager/index.php) Could not load context: mgr
[2010-11-13 14:46:29] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:46:34] (ERROR @ /index.php) Could not load context: web
[2010-11-13 14:48:16] (ERROR @ /index.php) Could not load context: web
[b][b]Thanks for your help on this. [/b]
-
MODX Staff
- 10,725 Posts
Sounds like your cache directory and/or all of files/folders within it have suddenly become unwritable by the PHP process.
Could this be a permissions issue? I have checked the permissions on the server files and they seem to all be at least readable and writable by owner but to be honest im not exactly sure what files i need to check. I dont want to go around and start allowing everything to have full access.
Is there any specific folder i need to be checking? Do you think i have hope in resolving this or am looking at a fresh install?
Also do you think i could resolve this by doing an upgrade to the latest version of modx?
Thanks for all the help OpenGeek.
Thanks for all your help on this. In the end i had to do a reinstall which wasnt that long. After backing up the DB it was just a simple case of reinstalling the CMS and a few packages. However i did notice that i had a few issues deleting the old files from the server which i logged with the hosting company and all seems fine now so maybe it was an issue with them.
I do have one questions regarding cleaning the cache files within Modx. How often do you think this should be done?