Going to: /update.php?op=results
Cause:

warning: array_pop(): The argument should be an array in update.php on line 314.

I know that I haven't specified any argument, but anyway it could be fixed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gusmiranda’s picture

Same error from a 6.10 to 6.12 upgrade.

array_pop() [function.array-pop]: The argument should be an array in /usr/share/drupal6/update.php on line 314.

Any clue? Thanks.. Gus

gusmiranda’s picture

Check this, probably helps... Gus.

http://bugs.php.net/bug.php?id=44844

Bug #44844 array_pop brings error message if parameter is not an array

Seeya!. Gus

ShannonK’s picture

Priority: Normal » Critical
FileSize
35.19 KB

So what is the solution then? I don't understand the link in #2. Other than identifying it is a bug, I don't see what the solution is to fixing it. I'm getting this error message after running update.php (I had just updated the Views module). Now my site won't show up at all. Please help!

elvis2’s picture

It seems to be one of your contributed modules. What modules did you update before running update.php?

sinsinapsi’s picture

Hi,
I get the same error after updating activity. But not immediately after de update, : the page of result don't report error.
I found this error only if I verify logs and reports,
then
I go to http://www.************/update.php?op=results page, I reload the page and found the error :

warning: array_pop() [function.array-pop]: The argument should be an array in /var/www/www.lupeficara.com/site/art-bender/update.php on line 314.

The update process was aborted prematurely while running update # in .module. All errors have been logged. You may need to check the watchdog database table manually.

I verified line 314 in update.php
and it is:

list($module, $version) = array_pop(reset($_SESSION['updates_remaining']));

My whole site seems work,
but the module page is blank

Someone have found fix?

Thanks

kenorb’s picture

#5: Report this issue separately for activity module
http://drupal.org/project/issues/activity

sinsinapsi’s picture

Ok, sorry and thank you.

fabsor’s picture

This can also occur when you run the update process without any updates to run. I attach a patch on a proposed solution to this problem here. Please feel free to develop on it!

EDIT: Damn Finder, can't handle file extensions correctly

fabsor’s picture

Rerolling patch with right extension (Sigh... I want my nautilus file manager back =)

flickerfly’s picture

Perhaps of interest, updates work fine from drush when I get this error in the web-interface.

thekevinday’s picture

There is a problem with this patch...or more accurately, there is a problem with the interpretation.

First some links:
http://drupal.org/getting-started/6/admin/build/modules
http://drupal.org/upgrade/running-update-php
http://drupal.org/node/480134

It is explicitly mentioned that update.php should be run on every module update.

If a user follows this logic, they will then get the message the patch provides when there are no updates to perform.

Now after reading this message the user will think that when there are no updates displayed on the update page then the update will not need to be performed.

And then any of the modules out there that do not setup the appropriate necessities to make their module appear on the update.php page, but still require the update.php to be run will not happen.

This will introduce confusion and cause more problems..

The question I have is:
Should an error message be displayed at all when update_success is not an array?
update.php still does operations (I think it clears the cache among other things) when it is run even though no updates are set to perform.
This means things do get changed, but no "update_success" array will be available.

zmove’s picture

Subscribe, I get this error and this is not the first time I update modules with this website.

When I go to the log to see the error, I have nothing reported under update and error filter, so this is hard to trace.

Anonymous’s picture

I have new updates to install, and get this error anyway. I can't update at all. It has to be server-related (shared web host), but I can't figure out what. Its a painful bug.

dyke it’s picture

subscribe

ShannonK’s picture

I'm getting this error again. When it happened before, I deleted a couple modules that were unimportant to me, and the error disappeared. Unfortunately, I don't remember the modules. Also, I don't know if this was a coincidence. Now I'm getting the following error upon update.php:

"An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.
Please continue to the error page
An HTTP error 0 occurred. http://mysite.org/update.php?id=92&op=do"

and then the same array_pop error on the error page:

"array_pop() [function.array-pop]: The argument should be an array in /home/shannonm/public_html/update.php on line 314"

I had just updated Smart tabs/menus, which seemed to go fine. Then updated to Drupal 6.15. I ran cron successfully, and it shows my version as 6.15 with no updates necessary for the rest.

Anyone have any idea what's happening??

emTque’s picture

subscribe

ShannonK’s picture

FileSize
26.77 KB
22.56 KB

I'm still receiving this error anytime I run update.php. I attached a screenshot of the first error, followed by the error page. You'll see it's blaming the weather module that I recently updated, however, I received the error initially on updating the Smart Tabs module. I think I'll get the error no matter what I'm updating.

When I run cron, it says that all modules and Drupal core are up to date. But there's a red X by "Database Updates." So I click the "database update script" (which I think is the same thing as update.php, right?). Which puts me in the loop of receiving the same errors again.

Anyone know what's going on or receive similar messages?

When it states on the error page to check the "watchdog" database, can someone tell me how to do that and what I'd be looking for there?

EDIT:
Would this have anything to do with me recently making the whole site secure with SSL (https)??

mths’s picture

Is there really a problem?
Does anybody have problems with their sites because of this error? I wonder because I added this line in update.php before line 314:
print_r($_SESSION['updates_remaining']);
It gives as output "Array ()" so it seems to me there are no errors to report?

So besides a annoying message, is there a problem?

modctek’s picture

I think there is a problem, but the error message may be misleading. I've never received this error message until today (after using 6.x for months on about half a dozen websites), and it only cropped up after I stripped out a bunch of old modules, and then tried to updated the Admin Block module. Now, I can't update any module on the affected website. Not good!

Update: Nevermind. Saw in another thread this may be related to browser cache issues. I jumped into IE7 and performed an update with no problems. Very odd.

zirafi’s picture

Hi,

Could someone let me know if there is fix for the original issue of this thread, I mean I am also having same issue as mentioned in #5 and my site is currently down because of this STOPPER bug and I did not find any clue so far. I appreciate you if you can point me a solution to fix this issue.

thanks,
~Paradesi

mikerainey’s picture

Version: 6.x-dev » 6.14

My site was working perfectly about 2 weeks ago then I started receiving the above mentioned Error message:

Drupal database update
warning: array_pop() [function.array-pop]: The argument should be an array in /data/0/0/13/80/13895/user/14211/htdocs/site/update.php on line 314.

The update process was aborted prematurely while running update # in .module. All errors have been logged. You may need to check the watchdog database table manually.

And the update process was aborted. I went to the extreme of installing a brand new "out of box" version and as soon as it is installed, without even making any changes. I get the same error. It looks like it may be a new issue with the core? I contacted my Hosting Company, Network Solutions, which actually has a fairly automated way of installing Drupal on there servers via a open source control panel. And asked if they had any ideas and could it be the PHP install. After several interactions they told me it was a software issue.

Can anyone help? Is there a new patch or something? I don't want to start rebuilding my site or installing modules until I get this issue resolved. HELP!! lol

flickerfly’s picture

Version: 6.14 » 6.x-dev

6.x-dev indicates all previous version of Drupal 6 including 6.14.

Sorry I can't offer you anything more except you can probably find something more helpful and less expensive than Network Solutions (in my experience anyway).

ShannonK’s picture

For anyone receiving this error...if you have changed your .htaccess file, it might be the culprit. See post: http://drupal.org/node/610314

amklose’s picture

#19 modctek had the answer for me.....

Delete your browsing data including cache files and then log back in as your superuser and try the update again. It worked for me!

Thanks modctek!

michellezeedru’s picture

We experienced this error as well, and found it was related to recently updating our sites with SSL. The solution was to change the base url in settings.php to reflect the new url - "https://oursite.com" (previously it had been "http://oursite.com").

Hope that's helpful to someone!

ShannonK’s picture

Your solution didn't work for me unfortunately. I get this error:

"An HTTP error 0 occurred. http://mysite.com/update.php?id=156&op=do"

And then this one on the error page:

"warning: array_pop() [function.array-pop]: The argument should be an array in /home/myname/public_html/update.php on line 314."

I had to go back to my old workaround...which is to comment out this in .htaccess:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L

Run update.php (which now runs correctly with no errors)...

Then go back to .htaccess and uncomment the above code to bring it back to SSL.

I don't know what is happening here, but that's the only solution that's worked for us thus far unfortunately.

deoxyna’s picture

Same thing here. It only works in IE8. Is this a browser problem?

pgend’s picture

Title: array_pop(): The argument should be an array in update.php on line 314. » array_pop(): The argument should be an array in update.php on line 314
Version: 6.x-dev » 6.16

I'm a new user Drupal 6.16 and I was testing a lot
I don't remember what I was doing exactly but after I logged out :
- each time I tried to connect : blank page
- After backing up manually to preserve configuration : I tried to update.php
- now when I try to log in, I always get an internal server error 500 and trying install.php writes array_pop(): The argument should be an array in update.php on line 314

please help

Vacilando’s picture

Version: 6.16 » 6.17

Got the same error running /update.php in D6.17.

Pandelon’s picture

Try in IE!

I don't know why, but in IE runs the update without errors.FF drops the error messages.

evyawebsites’s picture

i get the same error as well, I it seems like the views module is in conflict with another module im not sure which one yet but i strongly fell its the xml sitemap. did anyone saw that error with these 2 modules implemented ?

Brian Keller-Heikkila’s picture

The bad news is I just had this problem with Drupal 6.19. The good news is that I think I found a solution, at least the one that worked for me.

I had $base_url set in sites/default/settings.php due to previous testing. We later changed the site domain in DNS and setup a 301 redirect in httpd.conf to go from the old URL to the new. Unfortunately, when we changed the domain of the site, we forgot that $base_url was set to the old url.

Since we didn't need that set anymore, I commented out $base_url and update.php worked again with no array_pop() errors.

So I guess what this boils down to is that if you use $base_url, make sure it stays updated.

Anonymous’s picture

Version: 6.17 » 6.20

Emerged from the same situation by clearing cache. At least, so far no more weird behavior.

I've been upgrading various modules and then core (6.19 to 6.20) on a raft of Drupal sites.
All the same setup, no modifications to base_url or .htaccess, no difference in permissions, no difference in the way they're set up in httpd.conf
It was all going routinely.
Then I upgraded Views and Calendar modules on yet another site and got the error mentioned in this thread.

I flushed the cache; didn't log back in, just ran update again.
The error page ("this didn't work, try reloading page later", etc.) appeared again, but on reload, all seemed well.
I then did core update and all still seems well.

Since people are mentioning browsers, I was using Chrome for the updates, and Safari to check the result.

Thanks to modctek (#19), and amklose for pointing to modctek

Anonymous’s picture

I spoke too soon. Tried to upgrade another site, tried to run cron first and got the error page ("this didn't work, try reloading page later", etc.).

Noting heaps of unused modules, I thinned them out.
On succeeding reloads of the module list, the error page would appear, then the list would successfully appear on reload.
This happened less frequently as the module list shrank, and I was even able to run update, but my happiness was shortlived.

When I tried to upgrade core, the error page popped up and I could not get past it (cleared browser cache, Drupal cache, no help).
I retreated to version 6.19 (I generally keep the old versions and change symlinks to upgrade).

The log entries were full of items that seemed unrelated to the current problem:
Location http://xxxxx/admin_menu/flush-cache?destination=user%2F6
Message in_array() [function.in-array]: Wrong datatype for second argument in {mysite}/sites/all/modules/date/date_api.module on line 1962.

However, just trying to view the log entries often produced the error page.
Ditto when I tried to see a list of content, or a list of views.
Nerve impulse travels to brain... it seems related to admin pages. But that's as far as I've gotten.
So, the site has up-to-date non-core modules, but I can't upgrade core.

tpanar’s picture

I just hit this error for the first time going from 6.16 to 6.20 when upgrading the CAPTCHA module. Here are the steps as I remember them, and how I got around the error.

1) Drupal site taken offline.
2) Theme put back to base, all modules disabled.
3) Drupal core updated (success).
4) All modules reenabled from step 2.
5) Updated couple other modules (success update.php after each one, but had no db changes from them).
6) Theme reset.
7) Site put online and checked.
8) Site taken offline.
9) CAPTCHA module copied over. Error in update.php when trying to run.

********************************************************
Steps I used to fix:
********************************************************
10) Disabled CAPTCHA and derived modules.
11) Set theme back to base.
12) Update.php run successfully, db change made.

tpanar’s picture

So after futher testing, I narrowed the steps to reproduce even further. It appears that if I tried a page refresh to re-run update.php, I would get the error. Whereas if I followed the link directly from the modules list, everything worked fine.

smscotten’s picture

I got the array_pop() error when I removed a module that update.php is trying to update (and failing). Disabling and uninstalling the module didn't help any, update is still trying to update the module. So I deleted the module's directory and ended up with the array_pop() issue.

Solution to the array_pop() issue was to put the module's files back. It's still failing the update, but with a different error message so I'll have to open a different issue for it. I'm still totally unable to update my site, but I hope this information will be helpful. I have no idea why update.php wants to update modules that aren't there anymore.

scottm316’s picture

Fixing $base_url in settings worked for me! Thanks!

crifi’s picture

Yes, I can confirm: This problem is caused by calling the updater over a wrong base_url.

synesis’s picture

The base URL solved the problem for us. We had the .htaccess file forcing www, but our base url in the settings file was missing the www.

crifi’s picture

Status: Active » Closed (duplicate)

This problem is caused by a wrong configuration of $base_url and should be prevented by inserting a warning message to the requirements system. Therefore I created a new issue and this is now a duplicate of #1046682: Install/Update process fails if $base_url is set to a wrong URL. Please reopen if I'm wrong. Thanks!

iyyappan.govind’s picture

Issue summary: View changes

Really thank you..I had this problem in drupal 7. I have added the www in the base url. It solved the problem. Thanks

newswatch’s picture

Version: 6.2 » 10.1.x-dev

I ran int this problem suddenly. #41 helps.