Hello!

I'm gettings these errors when installing drupal 8 on my server:

Notice: Undefined variable: finished in _batch_process() (line 312 of core/includes/batch.inc).
_batch_process(Array)
_batch_progress_page()
_batch_page(Object)
install_run_task(Array, Array)
install_run_tasks(Array)
install_drupal(Object)
Notice: Undefined variable: label in _batch_process() (line 329 of core/includes/batch.inc).
_batch_process(Array)
_batch_progress_page()
_batch_page(Object)
install_run_task(Array, Array)
install_run_tasks(Array)
install_drupal(Object)

it's stuck at the Website install step.
pls. see screenshot..

are my server settings wrong?

Comments

maki3000 created an issue. See original summary.

mherchel’s picture

Let's get more info:

  • What web server? (Apache, Nginx, IIS?)
  • What version of PHP?
  • Does this happen if you select English as the install language?
cilefen’s picture

Category: Bug report » Support request
Priority: Major » Normal

I am sorry you are having trouble installing.

are my server settings wrong?

This may sound cheeky, but, how would we know if you don't tell us what they are?

I am making this a normal support request until we determine if there is a bug. Did you check the requirements? If you are accustomed to Drupal 7, the requirements are a little different. In a perfect world, the installer process finds missing requirements, but it does not always. I don't think I have seen anyone report this specific error yet, so I look forward to your response.

cilefen’s picture

Title: Drupal 8 installation problems » Notice: Undefined variable: finished in _batch_process() during install
Component: batch system » install system
maki3000’s picture

StatusFileSize
new418.49 KB

@mherchel: yeah! sorry for not mentioning this.

What web server? (Apache, Nginx, IIS?)

- Apache

What version of PHP?

- PHP Version 5.6.3

What version of MySQL?

- 5.5.40

Does this happen if you select English as the install language?

german

@cilefen: yeah! you're right. sorry for being not specific enough
i did check the requirements. as long as i know, it's ok what i have.
i looked at the Database and the PHP version. not more. do i check something else?

i think that there could be something wrong with missing library for the batch mode. but's that sort of a wild guess.
it did also stuck while installing every thing. i did make some refresh there and with every refresh it proceeded bit more.

cilefen’s picture

Can we get your full phpinfo() output, attached as a text file?

maki3000’s picture

StatusFileSize
new929.12 KB

Of course!
is PDF also ok?

THX for your help!

cilefen’s picture

Title: Notice: Undefined variable: finished in _batch_process() during install » Notice: Undefined variable: finished in _batch_process() during install in German with Apache/FastCGI
Issue tags: +fastcgi

I added to the title that this is a FastCGI installation and that it is an install in German, in case the translation process is involved.

Are the notices shown in the first screenshot a complete list of errors? I would like to see the server PHP error log that results at this step too.

maki3000’s picture

Are the notices shown in the first screenshot a complete list of errors?

Yes. the list continues, but it's just a repetition of the same errors.

Here's the tail of my PHP error log. everything that concerns my drupal installation:

http://web32.login-53.hoststar.ch/div/templates/meh_webvorlage_original_drupal8a
[Tue Dec 01 17:59:36 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:00:27 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:01:29 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:01:41 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_flag not allowed here
[Tue Dec 01 18:01:46 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:01:51 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:01:55 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_flag not allowed here
[Tue Dec 01 18:01:59 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:02:18 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:02:24 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_flag not allowed here
[Tue Dec 01 18:02:29 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:02:33 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_value not allowed here
[Tue Dec 01 18:02:37 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/.htaccess: php_flag not allowed here
[Tue Dec 01 19:00:25 2015] [alert] [client 81.221.12.109] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/sites/default/files/.htaccess: Options not allowed here, referer: http://web32.login-53.hoststar.ch/div/templates/meh_webvorlage_original_drupal8a/
[Tue Dec 01 20:18:07 2015] [error] [client 87.245.84.37] File does not exist: /home/www/web32/html/website/creation-handicap/favicon.ico
[Tue Dec 01 23:48:02 2015] [alert] [client 83.77.130.144] /home/www/web32/html/div/templates/meh_webvorlage_original_drupal8a/sites/default/files/.htaccess: Options not allowed here, referer: http://web32.login-53.hoststar.ch/div/templates/meh_webvorlage_original_drupal8a/
[Tue Dec 01 23:48:11 2015] [error] [client 83.77.130.144] File does not exist: /home/www/web32/html/favicon.ico, referer: http://web32.login-53.hoststar.ch/div/templates/meh_webvorlage_original_drupal8a/info.php
[Wed Dec 02 13:08:48 2015] [error] [client 62.138.0.25] File does not exist: /home/www/web32/html/website/creation-handicap/shop/img/p/136-991-medium.jpg
[Wed Dec 02 15:24:43 2015] [error] [client 62.138.0.25] File does not exist: /home/www/web32/html/website/creation-handicap/shop/img/p/123-887-medium.jpg
[Wed Dec 02 15:30:22 2015] [error] [client 178.38.91.99] File does not exist: /home/www/web32/html/favicon.ico, referer: http://web32.login-53.hoststar.ch/div/templates/meh_webvorlage_original_drupal8a/info.php
[Wed Dec 02 15:31:26 2015] [error] [client 178.38.91.99] File does not exist: /home/www/web32/html/favicon.ico
[Wed Dec 02 15:31:26 2015] [error] [client 178.38.91.99] File does not exist: /home/www/web32/html/favicon.ico
[Wed Dec 02 15:31:44 2015] [error] [client 178.38.91.99] File does not exist: /home/www/web32/html/favicon.ico, referer: http://web32.login-53.hoststar.ch/div/templates/meh_webvorlage_original_drupal8a/info.php

And yes! sorry again for not mentioning this earlier:
I needed to comment out some .htaccess rules for my server. otherwise it gave me a 500 error. Here's the stuff i commented out:

# Don't show directory listings for URLs which map to a directory.
#Options -Indexes

# Most of the following PHP settings cannot be changed at runtime. See
# sites/default/default.settings.php and
# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
# changed at runtime.

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  #php_value assert.active                   0
  #php_flag session.auto_start               off
  #php_value mbstring.http_input             pass
  #php_value mbstring.http_output            pass
  #php_flag mbstring.encoding_translation    off
  # PHP 5.6 has deprecated $HTTP_RAW_POST_DATA and produces warnings if this is
  # not set.
  #php_value always_populate_raw_post_data   -1
</IfModule>
cilefen’s picture

If this is a FastCGI integration issue, then I am not knowledgable.

What is the full list of disable_functions in the phpinfo()? It is cut off in the PDF. We have had some issues about disabled functions.

karolus’s picture

Not sure if this would be different for Drupal 8, but I'm running Drupal 7 installs on a FastCGI wrap.

To run it, no modifications were needed for Drupal core, save the .htaccess file. Besides that, there's the addition of a php5.cgi code to my cgi-sys folder on the server.

This, no doubt varies between Web hosts, so you want to check with yours on the specifics.

Below, is what I had to add to the .htaccess file

# Below Added to enable CGI-PHP for Drupal
Action application/[host-specifiic settings] /cgi-sys/php-cgiwrap/[host-specifiic settings]/php5.cgi
  AddType application/[host-specifiic settings] .php

It may also help to say that I needed to run Drupal on FastCGI not for the initial install (use Drush to move files via rsync), but when some modules such as Ctools needed to create cache files. So, once the site had been set up, I would be getting all sorts of errors on this, since with user set to nobody, Drupal could not write due to permissions issues. It appears the install process is running into a similar issue here.

maki3000’s picture

For Drupal 7 update module i set the batch mode to FALSE to have it worked.
Described in here: https://www.drupal.org/node/399572#comment-6470882

don't know if that's the same issue?

maki3000’s picture

it seems that i'm not able to do the installation on chrome, because the JS-Files don't get loaded. Check e.g. this error msg:
Refused to execute script from '*' because its MIME type ('text/x-js') is not executable, and strict MIME type checking is enabled.

i took out the Header always set X-Content-Type-Options nosniff from the .htaccess file, but it still does not work. is the nosniff stuff also sent in the headers?

When i do the installation on Firefox, it works!!!

Maybe check this stackoverflow ticket: http://stackoverflow.com/questions/24528211/refused-to-execute-script-fr...

maki3000’s picture

Nobody else got this problem with chrome?

Refused to execute script from '*' because its MIME type ('text/x-js') is not executable, and strict MIME type checking is enabled.

so should i close this ticket and make a new one?

maki3000’s picture

We have a Drupal ticket for that:
https://www.drupal.org/node/2601398

Also there is a stackoverflow ticket concerning this case:
http://stackoverflow.com/questions/24528211/refused-to-execute-script-fr...

exile_ch’s picture

I have the same issue:
because its MIME type ('text/x-js') is not executable, and strict MIME type checking is enabled. The website works so far an mobile devices, but not with chrome and IE. I have yet to test with FF.

funny, also with the same provider: hoststar :-) coincidence?

I tried the workaround with commenting out the header-nosniff thingy, it worked quite well for me. According to a few developers in our company, there are high security pages also using this workaround, so I don't worry about a bands website :-)

kieranm’s picture

This bug with CGI doesn't seem to be confined to the German language install and set up of Drupal 8.3. CGI/ FastCGI bug on Drupal 8.3.x with PHP 5.5.3 on English Language install and setup.

Only local images are allowed.

grantkruger’s picture

I just had this problem and more installing a fresh 8.3.0 site on Chrome for a DrupalCon training. In my case it also hung up at initialising at 0%. Multiple refreshes later I got the same error messages reported here. Per maki3000's comment at #13 (thank you!) I was able to resolve both problems simply by switching to Firefox.

joseb’s picture

@grantkruger and anyone else experiencing this issue:

I also had the same problem: stuck at 0% and after multiple refreshes I got the same error messages. My solution turned out to be quite simple: I just cleared my browser cookies for the site in question and the errors went away.

I hope it helps!

Jose B

Version: 8.0.0 » 8.0.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Version: 8.0.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

ivoo56’s picture

yes joseb!
This helped me a lot.
Thank you!

yash_khandelwal’s picture

I am facing a related issue in Drupal core 9.2.x.

Problem/Motivation:

Batch API hangs and only works once after clear browser cookies/cache/history.

Steps to reproduce

When I perform bulk operation the first time via views/custom, batch works as expected. But in the second time, the batch process hang. I checked error logs and found the below errors related.

Notice: Undefined variable: finished in _batch_process() (line 355 of /docroot/core/includes/batch.inc)

Also, I am using Views Bulk operation and It gives the below error on the batch operation.

Notice: Undefined index: total_results in Drupal\views_bulk_operations\Form\ConfirmAction->addListData()

I read one issue comment #19 and as mentioned that after clearing the browser cache, the batch again works but only one time.

Please help and suggest a permanent solution for this issue.

yash_khandelwal’s picture

Version: 8.9.x-dev » 9.2.x-dev

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

cilefen’s picture

Status: Active » Closed (outdated)

For the install problem if anyone can create a perfectly reproducible setup on the current release, post the details and reopen this.

djmorris93’s picture

I have been encountering the same issue using both edge chromium and also firefox.
The error is

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

Warning: Undefined variable $finished in _batch_process() (line 355 of core/includes/batch.inc).

_batch_process(Array) (Line: 186)
_batch_progress_page() (Line: 86)
_batch_page(Object) (Line: 666)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

The installation progress bar froze unless I refreshed the page and then at the end of the installation, these errors shows, and I had to reload the install.php page for it to enable me to enter my site details. then when I got into my site, these errors shows up again, and if I tried to navigate the size, I got the message (site) Apologizes for any inconvenience caused by this error. Error 500

This is installed using a hosting provider, and the database is 10.4.26-MariaDB-log - MariaDB Server
I am using PHP version 7.4