Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24539] Hyperloop: Android - Unhandled CLI error thrown sometimes

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-06-22T12:17:43.000+0000
Affected Version/sn/a
Fix Version/sHyperloop 2.1.2
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterHans Knöchel
AssigneeJan Vennemann
Created2017-03-28T09:55:06.000+0000
Updated2017-06-23T00:06:37.000+0000

Description

When building Hyperloop for Android, sometimes one of the following errors is thrown:
[INFO]  Starting Hyperloop assembly
[INFO]  [Hyperloop] Using system metabase cache file at /var/folders/tt/7hv0vw1d4nx64kbpcdd4dsn00000gn/T/hyperloop_android-23_metabase.4b1ef509144aeedbb0887170e4fa336933582ed3.json.gz
[INFO]  Skipping Hyperloop compile, no usage found ...
[INFO]  Finished Hyperloop assembly
[ERROR] read ECONNRESET
or (twice now)

[INFO]  Starting Hyperloop assembly
2017-03-28T08:40:02.077Z | ERROR  | An uncaught exception was thrown!
Cannot read property 'shift' of undefined
2017-03-28T08:40:02.078Z | ERROR  | Cannot read property 'shift' of undefined
This happens randomly and can be resolved by doing a clean build. Even when not changing anything Hyperloop-related, this happens from time to time. *EDIT*: Additional logs (only occurred once in trace-mode):
[INFO]  Starting Hyperloop assembly

/Users/jonahpolack/Library/Application Support/Titanium/plugins/hyperloop/2.0.1/node_modules/node-appc/node_modules/wrench/lib/wrench.js:382
            var filename = files.shift();
                                ^
TypeError: Cannot read property 'shift' of undefined
    at rmFile (/Users/jonahpolack/Library/Application Support/Titanium/plugins/hyperloop/2.0.1/node_modules/node-appc/node_modules/wrench/lib/wrench.js:382:33)
    at /Users/jonahpolack/Library/Application Support/Titanium/plugins/hyperloop/2.0.1/node_modules/node-appc/node_modules/wrench/lib/wrench.js:394:11
    at FSReqWrap.oncomplete (fs.js:82:15)

Comments

  1. Christopher Williams 2017-04-19

    So I don't actually use wrench in hyperloop JS code itself, so I think this is actually coming through from the node-appc dependency (as you can see in the file paths above). It's possible that [~hansknoechel]'s PR for node-appc here would fix it? https://github.com/appcelerator/node-appc/pull/122
  2. Jan Vennemann 2017-06-22

    This was caused by running multiple .aar transforms in parallel. During the transform we copy the assets directory which caused unexpected behavior when multiple I/O operations happened on the same destination folder. PR (master): https://github.com/appcelerator/hyperloop.next/pull/184 PR (2_1_X): https://github.com/appcelerator/hyperloop.next/pull/185
  3. Abir Mukherjee 2017-06-23

    I tested with this environment: Node Version: 6.10.3 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.2 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.1.1.v20170621181735 Appcelerator Studio, build: 4.9.0.201705302345 Xcode 8.3.2 Hyperloop version 2.1.2 Beta 3 I was able to reproduce the bug using Hyperloop version 2.1.1 and 5 aar files in the project:
    [INFO]  Starting Hyperloop assembly
       2017-06-23T00:00:12.998Z | ERROR  | An uncaught exception was thrown!
       Cannot read property 'shift' of undefined
       2017-06-23T00:00:12.999Z | ERROR  | Cannot read property 'shift' of undefined
    I then switched to Hyperloop 2.1.2 Beta 3, and built the same app in succession 10 times, and the error did not occur.

JSON Source