I am writing an install profile for D8. I had a problem with my yaml files which caused this error. The error (with my yaml) isn't the bug. The fact that the progress bar doesn't tell you that an error occurred is the bug.

Currently when this happens the progress bad just keeps going, stuck waiting for a response.

Firebug throws this error to the console.

TypeError: Drupal.AjaxError is not a constructor
[Break On This Error] 	

throw new Drupal.AjaxError(xmlhttp, pb.uri);                     progre...8.0-dev (line 91)

The response from the server is:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <title>Home | Drupal</title>
    <meta charset="utf-8" />
<link rel="shortcut icon" href="http://localhost:8888/drupal/core/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<meta name="Generator" content="Drupal 8 (http://drupal.org)" />
<meta name="robots" content="noindex, nofollow" />
    <style media="all">
@import url("http://localhost:8888/drupal/core/misc/normalize/normalize.css?0");
</style>
<style media="all">
@import url("http://localhost:8888/drupal/core/modules/system/system.base.css?0");
@import url("http://localhost:8888/drupal/core/modules/system/system.admin.css?0");
@import url("http://localhost:8888/drupal/core/modules/system/system.theme.css?0");
@import url("http://localhost:8888/drupal/core/modules/system/system.maintenance.css?0");
</style>
<style media="screen">
@import url("http://localhost:8888/drupal/core/themes/seven/style.css?0");
</style>

<!--[if lte IE 8]>
<link rel="stylesheet" href="http://localhost:8888/drupal/core/themes/seven/ie.css?0" media="all" />
<![endif]-->
    <script src="http://localhost:8888/drupal/core/themes/seven/js/mobile.install.js?0"></script>
  </head>
  <body class="maintenance-page in-maintenance db-offline one-sidebar sidebar-first">

  
  <header id="branding">
    <h1 class="page-title">Home</h1>  </header>

  <div id="page">

    <div id="sidebar-first" class="sidebar">
              <img id="logo" src="http://localhost:8888/drupal/core/themes/seven/logo.png" alt="Drupal" />
                    <h2 class="element-invisible">Installation tasks</h2><ol class="task-list"><li class="done">Choose language<span class="element-invisible">(done)</span></li><li class="done">Choose profile<span class="element-invisible">(done)</span></li><li class="done">Verify requirements<span class="element-invisible">(done)</span></li><li class="done">Set up database<span class="element-invisible">(done)</span></li><li class="active">Installation profile<span class="element-invisible">(active)</span></li><li>Configure site</li><li>Finished</li></ol>          </div>

    <main id="content" class="clearfix">
                  Attempt to create an instance of unknown field fc68de01-a24b-451a-8602-2b80cc5d46c0    </main>

  </div>

  <footer role="contentinfo">
      </footer>

  </body>
</html>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frob’s picture

I just checked and Drupal.AjaxError is defined in /core/misc/ajax.js

This file isn't loaded on the install screen.

nod_’s picture

In the HTML you put, the progressbar script isn't added to this page. Can you show the HTML that has the progressbar script tag?

frob’s picture

It is just the standard progress bar that tells you it is installing modules.

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <title>Installing Drupal | Drupal</title>
    <meta charset="utf-8" />
<link rel="shortcut icon" href="http://localhost:8888/drupal/core/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<meta name="robots" content="noindex, nofollow" />
<noscript><meta http-equiv="Refresh" content="0; URL=http://localhost:8888/drupal/core/install.php?langcode=en&amp;profile=jmeip&amp;id=1&amp;op=do_nojs" />
</noscript><meta name="Generator" content="Drupal 8 (http://drupal.org)" />
    <style media="all">
@import url("http://localhost:8888/drupal/core/misc/normalize/normalize.css?0");
</style>
<style media="all">
@import url("http://localhost:8888/drupal/core/modules/system/system.base.css?0");
@import url("http://localhost:8888/drupal/core/modules/system/system.admin.css?0");
@import url("http://localhost:8888/drupal/core/modules/system/system.theme.css?0");
@import url("http://localhost:8888/drupal/core/modules/system/system.maintenance.css?0");
</style>
<style media="screen">
@import url("http://localhost:8888/drupal/core/themes/seven/style.css?0");
</style>

<!--[if lte IE 8]>
<link rel="stylesheet" href="http://localhost:8888/drupal/core/themes/seven/ie.css?0" media="all" />
<![endif]-->
    <script>
<!--//--><![CDATA[//><!--
var drupalSettings = {"basePath":"\/drupal\/","scriptPath":"","pathPrefix":"","currentPath":"","batch":{"errorMessage":"The installation has encountered an error.\u003Cbr \/\u003EPlease continue to \u003Ca href=\u0022http:\/\/localhost:8888\/drupal\/core\/install.php?langcode=en\u0026amp;profile=jmeip\u0026amp;id=1\u0026amp;op=finished\u0022\u003Ethe error page\u003C\/a\u003E","initMessage":"Initializing.\u003Cbr\/\u003E\u0026nbsp;","uri":"http:\/\/localhost:8888\/drupal\/core\/install.php?langcode=en\u0026profile=jmeip\u0026id=1\u0026op=do_nojs"},"ajaxPageState":{"theme":"seven","js":{"core\/misc\/jquery.js":1,"core\/misc\/domready\/ready.min.js":1,"core\/misc\/drupal.js":1,"core\/misc\/progress.js":1,"core\/misc\/jquery.once.js":1,"core\/misc\/batch.js":1,"core\/themes\/seven\/js\/mobile.install.js":1},"css":{"style.css":1,"system.base.css":1,"system.admin.css":1,"system.theme.css":1,"system.maintenance.css":1,"normalize.css":1,"ie.css":1}}};
//--><!]]>
</script>
<script src="http://localhost:8888/drupal/core/misc/domready/ready.min.js?v=master"></script>
<script src="http://localhost:8888/drupal/core/misc/jquery.js?v=2.0"></script>
<script src="http://localhost:8888/drupal/core/misc/jquery.once.js?v=1.2"></script>
<script src="http://localhost:8888/drupal/core/misc/drupal.js?v=8.0-dev"></script>
<script src="http://localhost:8888/drupal/core/misc/progress.js?v=8.0-dev"></script>
<script src="http://localhost:8888/drupal/core/misc/batch.js?1369216914"></script>
<script src="http://localhost:8888/drupal/core/themes/seven/js/mobile.install.js?0"></script>
  </head>
  <body class="maintenance-page in-maintenance db-offline one-sidebar sidebar-first">

  
  <header id="branding">
    <h1 class="page-title">Installing Drupal</h1>  </header>

  <div id="page">

    <div id="sidebar-first" class="sidebar">
              <img id="logo" src="http://localhost:8888/drupal/core/themes/seven/logo.png" alt="Drupal" />
                    <h2 class="element-invisible">Installation tasks</h2><ol class="task-list"><li class="done">Choose language<span class="element-invisible">(done)</span></li><li class="done">Choose profile<span class="element-invisible">(done)</span></li><li class="done">Verify requirements<span class="element-invisible">(done)</span></li><li class="done">Set up database<span class="element-invisible">(done)</span></li><li class="active">Installation profile<span class="element-invisible">(active)</span></li><li>Configure site</li><li>Finished</li></ol>          </div>

    <main id="content" class="clearfix">
                  <div id="progress" class="progress"><div class="bar"><div class="filled" style="width: 0%"></div></div><div class="percentage">0%</div><div class="message">Initializing.<br/>&nbsp;</div></div>    </main>

  </div>

  <footer role="contentinfo">
      </footer>

  </body>
</html>
nod_’s picture

if batch is on the page and has been added with drupal_add_library() like it should, ajax.js should be on the page. I'll see if that happens with the standard profile.

( edit ) looking more closely that's not the case.

nod_’s picture

Status: Active » Needs review
FileSize
487 bytes

ok the patch should make this js error go away. As for displaying the error, remember it used to be an alert? now it only shows up in the console.

To display that to users check #77245-15: Provide a common API for displaying JavaScript messages which is part of #1419652: JavaScript logging and error reporting.

frob’s picture

Status: Needs review » Reviewed & tested by the community

Beautiful. works.

shixish’s picture

I was getting this error when trying to install Drupal on my Windows 8 Wamp:
mysql 5.5.24
php 5.4.3
apache 2.4.2

I applied this patch, and the installer got farther than before.
I was getting this error when it got to the Help module (#29), now it gets to the Image module (#30), and produces this error:

uncaught exception: AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 404
Debugging information follows.
Path: http://localhost/drupal/core/install.php?langcode=en&profile=standard&id=1&op=do_nojs&op=do
StatusText: error
ResponseText: 

Line 0
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

ParisLiakos’s picture

i dont think this is totally fixed...enable simpletest module, and go try to run a test which you have first have hacked to fatal error...eg call an undefined function...
batch, will just stay there loading for ever..

Uncaught [object Object] progress.js:90

Shouldnt it report to me, that my test is failing? instead of just waiting there for ever, until i remember that i should check my apache error log...or the console, to see whether the test is still running, or actually crashed

nod_’s picture

Status: Fixed » Needs work

I'll be working on it in a few hours if nobody picks it up before.

ParisLiakos’s picture

tagging

ParisLiakos’s picture

Title: Progress bar creates doesn't stop on errors. » Regrression: Progress bar creates doesn't stop on errors.
Priority: Normal » Critical

and its a regression..so critical

pwolanin’s picture

Status: Needs work » Needs review
FileSize
531 bytes

This change at least stops the batch, but you dont' get the really nice table for the stack trace.

dawehner’s picture

FileSize
511 bytes
67.64 KB

As the DX is horrible I would propose to not throw an error in this case.

To trigger an error just write something like $foo->test(); in a test.
error.png

nod_’s picture

looks like it'd need to be wrapped in a <pre> or something to make the message readable at least.

Berdir’s picture

Yes, but it didn't do that before either, so it's not part of the regression IMHO and I'd be more than fine to get it in like that. In case of Simpletest, you can still see the error in better formatted way in the test results.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

yes #14 is exactly like it used to be and its rtbc imo
thank you!

frob’s picture

Berdir, so does that mean that we cannot put a pre tag on the output?

pwolanin’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
532 bytes

With PRE it does look better, though not sure where it's best added.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Great, thanks.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 872c343 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

frob’s picture

Status: Closed (fixed) » Active

This is still happening if there is a php error in the hook_install implementation.

The error happens and the batch fails but doesn't tell anyone. I will attempt to reproduce and post steps.

nod_’s picture

Make sure you clear your browser cache, especially if you're using chrome.

frob’s picture

Status: Active » Closed (fixed)

Switching back to fixed. This looks like a different error.

posted new bug report here. https://drupal.org/node/2036745