Tangerine-Community / docker-tangerine-base-image

Base image for Tangerine docker builds
0 stars 0 forks source link

Issue building docker image when adding some cordova plugins #1

Closed chrisekelley closed 4 years ago

chrisekelley commented 6 years ago

Some plugins install, others throw an error.

While running these commands:

RUN cordova plugin add cordova-plugin-whitelist --save
RUN cordova plugin add cordova-plugin-geolocation --save
RUN cordova plugin add cordova-plugin-camera --save
RUN cordova plugin add cordova-plugin-file --save
RUN cordova plugin add cordova-android-support-gradle-release --save
RUN cordova plugin add cordova-hot-code-push-plugin --save

I get errors similar to this for:

But not for cordova-plugin-camera!

Step 43 : RUN cordova plugin add cordova-plugin-whitelist --save
 ---> Running in 992be17292f6

You have been opted out of telemetry. To change this, run: cordova telemetry on.
(node:5) UnhandledPromiseRejectionWarning: Error: spawn ETXTBSY
    at ChildProcess.spawn (internal/child_process.js:330:11)
    at Object.exports.spawn (child_process.js:500:9)
    at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/superspawn.js:134:31)
    at Object.exports.maybeSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/superspawn.js:186:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:242:27
    at Array.map (<anonymous>)
    at Object.getInstalledPlatformsWithVersions (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:240:34)
    at Function.getFetchVersion (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/plugin/add.js:348:29)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/plugin/add.js:291:35
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:854:54)
(node:5) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
 ---> 052bcd827946

What is surprising is that cordova is still able to say it has successfully built the apk!

Step 49 : RUN cordova build
 ---> Running in bb49b7e2d8a4

beep boop

BUILD SUCCESSFUL in 2m 4s

Here are some listings of the plugins:

root@e23dd17b84b4:/.tmp-apk# cordova plugins ls
cordova-android-support-gradle-release 1.3.0 "cordova-android-support-gradle-release"
cordova-hot-code-push-plugin 1.5.3 "Hot Code Push Plugin"
cordova-plugin-camera 4.0.2 "Camera"
root@e23dd17b84b4:/.tmp-apk# ls -lsa plugins/
total 28
4 drwxr-xr-x  5 root root 4096 Mar 29 13:38 .
4 drwxr-xr-x 22 root root 4096 Mar 29 14:07 ..
4 -rw-r--r--  1 root root  386 Mar 29 13:38 android.json
4 drwxr-xr-x  3 root root 4096 Mar 29 13:38 cordova-android-support-gradle-release
4 drwxr-xr-x  6 root root 4096 Mar 29 13:38 cordova-hot-code-push-plugin
4 drwxr-xr-x  9 root root 4096 Mar 29 13:38 cordova-plugin-camera
4 -rw-r--r--  1 root root  551 Mar 29 13:38 fetch.json

This is similar to the issue here: https://github.com/nordnet/cordova-hot-code-push/issues/319

chrisekelley commented 6 years ago

I got the same error when trying to cordova plugin add cordova-plugin-whitelist --save

When I ran it without --save it worked.

I installed the other missing plugins.

root@e23dd17b84b4:/.tmp-apk# ls -lsa plugins/
total 40
4 drwxr-xr-x  8 root root 4096 Mar 29 14:16 .
4 drwxr-xr-x 24 root root 4096 Mar 29 14:16 ..
4 -rw-r--r--  1 root root  632 Mar 29 14:16 android.json
4 drwxr-xr-x  3 root root 4096 Mar 29 13:38 cordova-android-support-gradle-release
4 drwxr-xr-x  6 root root 4096 Mar 29 13:38 cordova-hot-code-push-plugin
4 drwxr-xr-x  9 root root 4096 Mar 29 13:38 cordova-plugin-camera
4 drwxr-xr-x  7 root root 4096 Mar 29 14:14 cordova-plugin-file
4 drwxr-xr-x  6 root root 4096 Mar 29 14:13 cordova-plugin-geolocation
4 drwxr-xr-x  4 root root 4096 Mar 29 14:16 cordova-plugin-whitelist
4 -rw-r--r--  1 root root 1078 Mar 29 14:16 fetch.json

Could it be an issue with using --save ?

chrisekelley commented 6 years ago

Aparently "ETXTBSY is a libc error that's raised when a process tries to modify a currently executing file."

https://github.com/npm/npm/issues/5526

Maybe place a 3 second pause between each cordova add?

I'm doing the install on a smaller AWS instance. Maybe it is running out of resources.

chrisekelley commented 6 years ago

So, you may need to go back into the instance after it's built, cd to /.tmp-apk and check what plugins are installed. If any are missing, manually add them.

rjcorwin commented 6 years ago

Perhaps we could have the install keep executing until it doesn't fail? A while statement in bash that while it returns a bad exit code, keep going. This does carry the risk of ending up in an infinite loop though.

chrisekelley commented 4 years ago

I'm closing this issue; we've resolved it already.