Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento Connect MAnager Gives Strange Error When Checking For Updates
 
whizzkidd
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2009-04-08
Kansas City, MO - USA
 

Help!
The Magento Connect Manager is giving me an error when I click check for updates. It is posted below:

Exception caught:

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /homepages/10/d265250573/htdocs/live/downloader/pearlib/php/PEAR/REST/10.php on line 671

Backtrace:

#0 [internal function]: mageCoreErrorHandler(2, ‘in_array() [listLatestUpgrades(’http://connect....’, ‘stable’, Array, ‘connect.magento...’, Object(Maged_Pear_Registry))
#3 /homepages/10/d265250573/htdocs/live/downloader/pearlib/php/PEAR/Command/Common.php(285): PEAR_Command_Remote->doListUpgrades(’list-upgrades’, Array, Array)
#4 /homepages/10/d265250573/htdocs/live/downloader/Maged/Pear.php(234): PEAR_Command_Common->run(’list-upgrades’, Array, Array)
#5 /homepages/10/d265250573/htdocs/live/downloader/Maged/Model/Pear.php(100): Maged_Pear->run(’list-upgrades’, Array)
#6 /homepages/10/d265250573/htdocs/live/downloader/template/pear/packages.phtml(49): Maged_Model_Pear->getAllPackages()
#7 /homepages/10/d265250573/htdocs/live/downloader/Maged/View.php(59): include(’/homepages/10/d...’)
#8 /homepages/10/d265250573/htdocs/live/downloader/Maged/Controller.php(113): Maged_View->template(’pear/packages.p...’)
#9 /homepages/10/d265250573/htdocs/live/downloader/Maged/Controller.php(355): Maged_Controller->pearPackagesAction()
#10 /homepages/10/d265250573/htdocs/live/downloader/Maged/Controller.php(170): Maged_Controller->dispatch()
#11 /homepages/10/d265250573/htdocs/live/downloader/index.php(35): Maged_Controller::run()
#12 {main}

I’ve also noticed some other strange things that might be related:

When I log into the Magento Connect manager it takes me to a 404 page.  If I then hit back, the browser goes to the Magento Connect Manager. 

Any help/advice would be greatly appreciated!

One More thing I have latest version installed 1.3.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

Seems like your last upgrade did not complete successfully. If you have SSH access, try these commands from your Magento root directory:

./pear install -f magento-core/Mage_All_Latest
./pear upgrade-all

Also, clear your cache:

rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
rm -rf var/cache/*

 
Magento Community Magento Community
Magento Community
Magento Community
 
whizzkidd
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2009-04-08
Kansas City, MO - USA
 

I appreciate the response, but I’m a little more confused now grin .  I’m new to SSH.  I’ve logged in, but the code commands you supplied aren’t working for me.  I realize that this is probably due to the fact that I have magento installed into a folder called live.  Would this be the correct command?

/live/pear install -f magento-core/Mage_All_Latest
/live/pear upgrade-all

and would this mean clearing the cache would be a similar command?
Please excuse my ignorance, I’ve tried just about every variation of a command I can think of via SSH, and I have no indication that it’s working.

Thanks in advance for any help!

Attached is a photo of the commands I tried via Putty.

Image Attachments
puttyscreen.gif
 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

You will need to change the working directory to your Magento root directory ("live" in your case). To change the directory, type “cd directory_name”, for example “cd live”. To list the content of the current directory, type “ls” or “ls -all”.

If you know the path of the document root on your server, you can type e.g.:

cd /full/path/to/magento/

The easiest way to find the document root is to create a php script docroot.php with the following lines of code:

<?php
echo $_SERVER['DOCUMENT_ROOT'];
?>

Upload the file to your Magento directory and load it in your browser. It should print out the full path to your document root.

Once you are in the correct directory on the SSH prompt, the commands in my previous post should work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
oscar_09
Jr. Member
 
Total Posts:  9
Joined:  2009-01-26
 

I’m receiving the same error when clicking the “check for upgrades” button after attempting to upgrade to 1.3.2, but none of the solutions provided in the forum to date fix the problem (i.e. I tried ./pear upgrade-all , ./pear -f install magento-core/Mage_All_Latest). All of these commands run and report no problems but do nothing to fix the error.

Magento admin reports the Magento version as 1.2.1 but Magento connect says the core components are stable at version 1.3.2. What is happening here? How can I fix without reinstalling the site? Have lots of modules installed and this is a live shop, so a complete reinstall is not really an option.

The error message received when clicking Check for Upgrades is:

Exception caught:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /public_html/downloader/pearlib/php/PEAR/REST/10.php on line 680

Backtrace:
#0 /public_html/downloader/pearlib/php/PEAR/REST/10.php(680): mageCoreErrorHandler(2, ‘in_array() [listLatestUpgrades(’stable’, false)
#2 /public_html/downloader/pearlib/php/PEAR/Command/Common.php(271): PEAR_Command_Remote->doListUpgrades(’http://connect....’, ‘alpha’, Array, ‘connect.magento...’, Object(Maged_Pear_Registry))
#3 /public_html/downloader/Maged/Pear.php(234): PEAR_Command_Common->run(’list-upgrades’, Array, Array)
#4 /public_html/downloader/Maged/Model/Pear.php(100): Maged_Pear->run(’list-upgrades’, Array, Array)
#5 /public_html/downloader/template/pear/packages.phtml(49): Maged_Model_Pear->getAllPackages(’list-upgrades’, Array)
#6 /public_html/downloader/Maged/View.php(59): include(’/home/intimate/...’)
#7 /public_html/downloader/Maged/Controller.php(113): Maged_View->template()
#8 /public_html/downloader/Maged/Controller.php(350): Maged_Controller->pearPackagesAction(’pear/packages.p...’)
#9 /public_html/downloader/Maged/Controller.php(170): Maged_Controller->dispatch()
#10public_html/downloader/index.php(35): Maged_Controller::run()
#11 {main}

The actual code at this line in 10.php is

if (in_array($new_state$this->betterStates($inst_statetrue)))

I’m new to Magento so don’t really know what it is doing there or how to troubleshoot/debug this one. There is nothing in the site’s error log or the apache error log.

Can anyone help me with some information on how to troubleshoot this?  Anything anyone can tell me would be MUCH appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

Try this from SSH:

upgrade -f magento-core/Mage_Core_Modules

If it complaints about any missing dependencies, install/upgrade them first.

Then clear your cache and reload the site:

rm -rf var/cache/*
 
Magento Community Magento Community
Magento Community
Magento Community
 
oscar_09
Jr. Member
 
Total Posts:  9
Joined:  2009-01-26
 

Thanks - ran this command and it runs successfully with no error messages. After that I’m getting a blank page on Magento’s front end or admin. Turned on php error reporting in index.php and now get this:

Warning: include_once(Varien/Autoload.php) [function.include-once]: failed to open stream: No such file or directory in /home/public_html/app/Mage.php on line 50

Warning: include_once() [function.include]: Failed opening ‘Varien/Autoload.php’ for inclusion (include_path=’/home/public_html/app/code/local:/home/public_html/app/code/community:/home/public_html/app/code/core:/home/public_html/lib:.:/usr/lib/php:/usr/local/lib/php’) in /home/public_html/app/Mage.php on line 50

Warning: include(Varien/Autoload.php) [function.include]: failed to open stream: No such file or directory in /home/public_html/app/code/core/Mage/Core/functions.php on line 68

Warning: include(Varien/Autoload.php) [function.include]: failed to open stream: No such file or directory in /home/app/code/core/Mage/Core/functions.php on line 68

Warning: include() [function.include]: Failed opening ‘Varien/Autoload.php’ for inclusion (include_path=’/home/public_html/app/code/local:/home/public_html/app/code/community:/home/public_html/app/code/core:/home/public_html/lib:.:/usr/lib/php:/usr/local/lib/php’) in /home/public_html/app/code/core/Mage/Core/functions.php on line 68

Fatal error: Class ‘Varien_Autoload’ not found in /home/public_html/app/Mage.php on line 53

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
oscar_09
Jr. Member
 
Total Posts:  9
Joined:  2009-01-26
 

Does anyone out there have any ideas about how I can fix this short of restoring back to v1.2 and having the Connect Manager not working? Desperate for a solution.... any help appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
gudphilip
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2007-12-20
Florida
 

Having the same issue…

Keep getting this error both when running the ./pear upgrade-all command in SSH and when trying to upgrade via Magento Connect

Warningin_array(): Wrong datatype for second argument in 10.php on line 680
PHP Warning
:  in_array(): Wrong datatype for second argument in /var/www/vhosts/hi-tecart.com/httpsdocs/downloader/pearlib/php/PEAR/REST/10.php on line 680

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 

What version of PHP are you guys running? I’m familiar with this error in other applications with PHP 4.x, but if you’re running PHP 5.x then have you considered downloading the same version of Magento you have installed and then copying over all the files to where you have Magento installed?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Charles Albert
Member
 
Total Posts:  56
Joined:  2008-06-24
 

Trying to upgrade my Magento installation via Magento Connect i had this same issue. I’ve corrected it by reapplying the chown in the magento folder, rising up the max_execution_time and memory_limit in the php.ini and .htaccess files, and then running ./pear mage-setup in the shell before ./pear install magento-core/Mage_All_Latest.

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top