JavaScript Optimizer "queued" status

1792
13
05-21-2014 09:51 AM
deleted-user-Jie3eyjOl9XM
Occasional Contributor
I've been working with the Optimizer for a couple days, and having a tough time getting everything configured the way it likes. It's a nontrivial application. At first, I just got a "queued" status. Then, for a while I was getting actual output. But, now I'm back to getting "queued". These builds remain queued for a long time, until I delete them.

I'm wondering, is there some kind of error or misconfiguration in my code that would cause the "queued" status? Or, is it really queued? Is there some kind of metering that's causing me to wait?
0 Kudos
13 Replies
derekswingley1
Frequent Contributor
We have pretty tight limits on how many builds can run concurrently so our servers for the app don't grind to a halt. My guess would be that your build is legitimately queued.

To investigate further, please answer:

  1. Is the account you're using an organizational or developer account?

  2. How long did you wait for your build to run?

0 Kudos
ReneRubalcava
Frequent Contributor
Just to test yesterday, I uploaded the zip fo the CSV Layer example (as-is) and just checked, it's still at status of "queued".
Maybe that's a bad sample to test off, but it's fairly simple, so not sure what's holding it up.

Developer Account and running around 24 hours now probably.
0 Kudos
deleted-user-Jie3eyjOl9XM
Occasional Contributor
My account is an organizational account, and my builds were queued for 24 hours now. I deleted them all this morning, since I'm pretty sure they were stuck.

I'll bet that the fault lies with my application. Sometimes I can get the build to "Scan". But, sometimes it won't "Scan", and it just sits queued.

A great addition to the help screen would be a demo layout, showing the dojoConfig, and a package.json. Maybe a trivial project in GitHub that builds successfully?

The application I'm uploading is a zip file (Windows compressed folder, if the algorithm matters).  My app is very similar to the Spriggs project, with the addition of a buildFile and the package.json files. Here's a simplified structure inside the zip, and maybe you can see any obvious errors:

ZipFile
  Scripts
    buildFile.html
    someWidget.js
    someOtherWidget.js
    app
      packages.json
      MyApp.js
    gis
      package.json
      dijit
        Draw.js
        Draw
          css
            ...
          images
            ...
          templates
            ...


Maybe you're wondering what this buildFile is all about. Since the actual html host page is complex, I've just created a simplified html file for the build system. It looks like this:

[HTML]
<!DOCTYPE html>
<html>
<head>
  <title>Map Build File</title>
</head>
<body>
        <script>
            var debugMode = true;
            var dojoConfig = {
                isDebug: debugMode,
                packages: [{
                    name: "/js",
                    location: ''
                },
                {
                    name: "/gis",
                    location: '/gis'
                },
                {
                    name: "/widget",
                    location: '/widget'
                },
                {
                    name: "/tool",
                    location: '/tool'
                },
                {
                    name: "/app",
                    location: '/app'
                }]
            };
        </script>
        <script src="//js.arcgis.com/3.9/"></script>
        <script>
            require([
                'app/MyApp',
                'dojo/io-query',
                'dojo/parser',
                'dojo/ready',
            ],
                function (MyApp, ioQuery, parser, ready) {

                    ready(function () {
                     parser.parse();
                        var options = {
                          debug: debugMode
                        };
                        var app = new MyApp(options);
                        app.startup();

                    }); // end ready

                } // end function

            ); //end require

        </script>
  </body>
</html>
[/HTML]

I had been specifying my start point as the build file. Instead, I specified the start point as my application file, but got the same results. Then, when I unchecked the advanced option "only include build files", the build doesn't even queue. It just hangs on the "Building" screen.

I should also mention, just in case, the my zip file includes both source and minified versions of all my javascript files. That's because I've configured Visual Studio to minify the files automatically. I assume the builder will ignore those.
0 Kudos
derekswingley1
Frequent Contributor
We had an issue from some time Tuesday through this morning where the queue was not working correctly. It's working now.

AJ:  why do you have slashes in your package names? I'm not used to seeing that and don't think it's something we tested. Can you try with names that don't use the slashes? As for minified files, yes, the app will ignore those.
0 Kudos
deleted-user-Jie3eyjOl9XM
Occasional Contributor
I received a build success notification last night. But, that's strange because I had deleted all of my queued builds except one. And, that one is still listed as queued since yesterday. So, maybe a result of the broken queue flushing? Or, something else happening, like the status of the builds is different than what's displayed on screen? Or, clicking "cancel" on a build doesn't actual remove it from the queue?

Derek: The quotes are in the package name because I have fat fingers. Thanks for finding that error. I removed them from my build file. In addition to fixing the package names, I simplified the layout of my project. And, I got on board with Grunt, so my files have much less lint. I thought that might have been an issue. Unfortunately, this build that I uploaded this morning is listed as queued, too.

Two more angles that could be causing an issue. First, my understanding is that the builder doesn't actually execute any JavaScript. Rather, is just scans the files for requires. So, things like document.location.protocol, and initialization parameters in the build file, won't be an issue. Second, I have to wonder about my build file. Suppose I forget about the build file, and just point the builder to the application entry point (javascript file). Since there would be no dojoConfig, how would the builder be able to locate my other packages, such as "tool", "widget", etc?
0 Kudos
derekswingley1
Frequent Contributor
Quotes or slashes?

Please don't start assuming "queued" means "broken". There are legitimate times when builds are queued. That being said, if your build is still queued now, something went wrong again (I just ran a build successfully).

If you have errors in your code you're likely to have problems generating a build.

If you don't have a dojoConfig that defines where to find custom packages you're referencing in your require or define calls the optimizer will fail.
0 Kudos
deleted-user-Jie3eyjOl9XM
Occasional Contributor
Quotes or slashes?

I mean to say slashes. They are gone now.


If your build is still queued now, something went wrong again.


Indeed, something is wrong. The optimizer doesn't like my code. I'll strip it down to the most basic, and add pieces back until it breaks. Then, I'll report back.
0 Kudos
derekswingley1
Frequent Contributor

Indeed, something is wrong. The optimizer doesn't like my code. I'll strip it down to the most basic, and add pieces back until it breaks. Then, I'll report back.


Thanks. I would expect the build to fail rather than stall out as "queued". If you're able to isolate what's causing this then that will help us all in the long run.
0 Kudos
deleted-user-Jie3eyjOl9XM
Occasional Contributor
Even with the most trivial html page, without external scripts, I can't get past the "queued" status. In fact, I can't even do a build by clicking and checking the modules. I don't think that this is a problem with the optimizer. Rather, it could be a problem with AGO authorization, or my account is throttled for too many cancelled builds.
0 Kudos