AWX docker images build error for Kubernetes

Hi,

I am running into following error during ‘Build AWX distribution using container’ step, kind of lost here since we do have npm and nodeJS installed on the server where I am running this playbook. Note that we don’t have access to root, so running the playbook and installs using a non-root id which has enough access to create and build docker images.

Any clue on what the issue is and workaround or solution would be?

Also I don’t see /.npm/_logs/2021-01-04T21_10_19_492Z-debug.log file mentioned in the error anywhere on the server.

Error:

npm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN rollback Rolling back fsevents@2.1.2 failed (this is probably harmless): EBUSY: resource busy or locked, unlink ‘/awx/awx/ui_next/node_modules/fsevents/.nfs000000000038f055000084c9’\nnpm WARN rollback Rolling back fsevents@1.2.13 failed (this is probably harmless): EBUSY: resource busy or locked, unlink ‘/awx/awx/ui_next/node_modules/jest-haste-map/node_modules/fsevents/.nfs000000000038df97000084e0’\nnpm WARN rollback Rolling back fsevents@1.2.13 failed (this is probably harmless): EBUSY: resource busy or locked, unlink ‘/awx/awx/ui_next/node_modules/webpack-dev-server/node_modules/fsevents/.nfs000000000036ba95000084d4’\nnpm WARN rollback Rolling back fsevents@1.2.13 failed (this is probably harmless): EBUSY: resource busy or locked, unlink ‘/awx/awx/ui_next/node_modules/watchpack-chokidar2/node_modules/fsevents/.nfs000000000036c231000084e7’\nnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):\nnpm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})\nnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):\nnpm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})\nnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):\nnpm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})\nnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):\nnpm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})\n\nadded 2024 packages from 1773 contributors and audited 2030 packages in 1133.177s\n\n100 packages are looking for funding\n run npm fund for details\n\nfound 0 vulnerabilities\n\n\n┌──────────────────────────────────────────────┐\n│ npm update check failed │\n│ Try running with sudo or get access │\n│ to the local update config store via │\n│ sudo chown -R $USER:$(id -gn $USER) /.config │\n└──────────────────────────────────────────────┘\nnpm --prefix awx/ui_next --loglevel warn run extract-strings\n\n> ui_next@0.1.0 extract-strings /awx/awx/ui_next\n> lingui extract\n\ninternal/modules/cjs/loader.js:883\n throw err;\n ^\n\nError: Cannot find module ‘./filter’\nRequire stack:\n- /awx/awx/ui_next/node_modules/fuzzaldrin/lib/fuzzaldrin.js\n- /awx/awx/ui_next/node_modules/@lingui/cli/api/utils.js\n- /awx/awx/ui_next/node_modules/@lingui/cli/lingui.js\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)\n at Function.Module._load (internal/modules/cjs/loader.js:725:27)\n at Module.require (internal/modules/cjs/loader.js:952:19)\n at require (internal/modules/cjs/helpers.js:88:18)\n at Object. (/awx/awx/ui_next/node_modules/fuzzaldrin/lib/fuzzaldrin.js:6:12)\n at Object. (/awx/awx/ui_next/node_modules/fuzzaldrin/lib/fuzzaldrin.js:80:4)\n at Module._compile (internal/modules/cjs/loader.js:1063:30)\n at Object.Module._extensions…js (internal/modules/cjs/loader.js:1092:10)\n at Module.load (internal/modules/cjs/loader.js:928:32)\n at Function.Module._load (internal/modules/cjs/loader.js:769:14) {\n code: ‘MODULE_NOT_FOUND’,\n requireStack: [\n ‘/awx/awx/ui_next/node_modules/fuzzaldrin/lib/fuzzaldrin.js’,\n ‘/awx/awx/ui_next/node_modules/@lingui/cli/api/utils.js’,\n ‘/awx/awx/ui_next/node_modules/@lingui/cli/lingui.js’\n ]\n}\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! ui_next@0.1.0 extract-strings: lingui extract\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the ui_next@0.1.0 extract-strings script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /.npm/_logs/2021-01-04T21_10_19_492Z-debug.log\nmake: *** [Makefile:480: awx/ui_next/.ui-built] Error 1\n", “status”: 2}

PLAY RECAP ********************************************************************************************************************
localhost : ok=10 changed=2 unreachable=0 failed=1 skipped=3 rescued=0 ignored=0

Thanks,
Sreeni

Hi Sreeni

greetings for the day

Can you please share a snippet of the playbook that you are using please to to do npm tasks

Regards
Abhinit Mallick

Abhinit, thanks for the response. Here is the Ansible task definition from awx/installer/roles/image_build/tasks/main.yaml file. I have not made any changes to this file or section after cloning the repository from Git hub.

  • name: Build AWX distribution using container
    docker_container:
    env:
    http_proxy: “{{ http_proxy | default(‘’) }}”
    https_proxy: “{{ https_proxy | default(‘’) }}”
    no_proxy: “{{ no_proxy | default(‘’) }}”
    image: “awx_sdist_builder:{{ awx_version }}”
    name: awx_sdist_builder
    state: started
    user: “{{ uid.stdout }}”
    detach: false
    volumes:
  • …/:/awx:Z
    delegate_to: localhost
    when: use_container_for_build|default(true)|bool

Here is Ansible logout for this task with some more information prior to it failing with the error.

TASK [image_build : Build AWX distribution using container] *******************************************************************
task path: /AWXSB/AnsibleAWX/awx/installer/roles/image_build/tasks/main.yml:65
ESTABLISH LOCAL CONNECTION FOR USER: myadmin
EXEC /bin/sh -c ‘echo ~myadmin && sleep 0’
EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /home/myadmin/.ansible/tmp”&& mkdir “echo /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835” && echo ansible-tmp-1609796097.03-19495-93975508577835=“echo /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835” ) && sleep 0’
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/docker/docker_container.py
PUT /home/myadmin/.ansible/tmp/ansible-local-18837byydxr/tmpFA92wC TO /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py
EXEC /bin/sh -c ‘chmod u+x /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/ /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py && sleep 0’
EXEC /bin/sh -c ‘/usr/bin/python /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py && sleep 0’
EXEC /bin/sh -c ‘rm -f -r /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/ > /dev/null 2>&1 && sleep 0’
fatal: [localhost]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“api_version”: “auto”,
“auto_remove”: false,
“blkio_weight”: null,
“ca_cert”: null,
“cap_drop”: null,
“capabilities”: null,
“cleanup”: false,
“client_cert”: null,
“client_key”: null,
“command”: null,
“comparisons”: null,
“cpu_period”: null,
“cpu_quota”: null,
“cpu_shares”: null,
“cpuset_cpus”: null,
“cpuset_mems”: null,
“debug”: false,
“detach”: false,
“device_read_bps”: null,
“device_read_iops”: null,
“device_write_bps”: null,
“device_write_iops”: null,
“devices”: null,
“dns_opts”: null,
“dns_search_domains”: null,
“dns_servers”: null,
“docker_host”: “unix://var/run/docker.sock”,
“domainname”: null,
“entrypoint”: null,
“env”: {
“http_proxy”: “”,
“https_proxy”: “”,
“no_proxy”: “”
},
“env_file”: null,
“etc_hosts”: null,
“exposed_ports”: null,
“force_kill”: false,
“groups”: null,
“healthcheck”: null,
“hostname”: null,
“ignore_image”: false,
“image”: “awx_sdist_builder:16.0.0”,
“init”: false,
“interactive”: false,
“ipc_mode”: null,
“keep_volumes”: true,
“kernel_memory”: null,
“kill_signal”: null,
“labels”: null,
“links”: null,
“log_driver”: null,
“log_options”: null,
“mac_address”: null,
“memory”: “0”,
“memory_reservation”: null,
“memory_swap”: null,
“memory_swappiness”: null,
“mounts”: null,
“name”: “awx_sdist_builder”,
“network_mode”: null,
“networks”: null,
“networks_cli_compatible”: null,
“oom_killer”: null,
“oom_score_adj”: null,
“output_logs”: false,
“paused”: false,
“pid_mode”: null,
“pids_limit”: null,
“privileged”: false,
“published_ports”: null,
“pull”: false,
“purge_networks”: false,
“read_only”: false,
“recreate”: false,
“restart”: false,
“restart_policy”: null,
“restart_retries”: null,
“runtime”: null,
“security_opts”: null,
“shm_size”: null,
“ssl_version”: null,
“state”: “started”,
“stop_signal”: null,
“stop_timeout”: null,
“sysctls”: null,
“timeout”: 60,
“tls”: false,
“tls_hostname”: “localhost”,
“tmpfs”: null,
“trust_image_content”: false,
“tty”: false,
“ulimits”: null,
“user”: “446”,
“userns_mode”: null,
“uts”: null,
“validate_certs”: false,
“volume_driver”: null,
“volumes”: [
“…/:/awx:Z”
],
“volumes_from”: null,
“working_dir”: null
}
},
“msg”: "npm --prefix awx/ui_next --loglevel warn --ignore-scripts install\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, lchown ‘/awx/awx/ui_next/node_modules/.staging/semver-96a41615/bin’\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, lchown ‘/awx/awx/ui_next/node_modules/.staging/debug-aeec2e21/src’\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, lchown ‘/awx/awx/ui_next/node_modules/.staging/@babel/plugin-syntax-async-generators-9ca6456e/lib’\nnpm WARN tar EACCES: permission denied, lchown ‘/awx/awx/ui_next/node_modules/.staging/@babel/helper-validator-option-02f16958/lib’\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown\nnpm WARN tar EACCES: permission denied, fchown

Hi,

Please share the below outputs

  1. output of sudo -l of myadmin user
  2. output of ls -ld < directory where awx repo is cloned >
  3. systemctl status docker

Regards
Abhinit Mallick

Here is the output for above 3 commands, removed unwanted information.

[myadmin@dmyadmin01 awx]$ sudo -l
Matching Defaults entries for myadmin on dmyadmin01:
!visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, env_reset, env_keep=“COLORS DISPLAY HOSTNAME
HISTSIZE KDEDIR LS_COLORS”, env_keep+=“MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE”, env_keep+=“LC_COLLATE
LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES”, env_keep+=“LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE”,
env_keep+=“LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY”, secure_path=/sbin:/bin:/usr/sbin:/usr/bin,
iolog_dir=/var/log/sudo-io/%{user}, log_output, log_input

Runas and Command-specific defaults for myadmin:
Defaults!/usr/bin/sudoreplay !log_output

User myadmin may run the following commands on dmyadmin01:
(root) NOPASSWD: ALL
[myadmin@dmyadmin01 AnsibleAWX]$ cd awx
[myadmin@dmyadmin01 awx]$ ls -ld
drwxrwxr-x 13 myadmin myadmin 8192 Jan 4 16:34 .
[myadmin@dmyadmin01 awx]$

[myadmin@dmyadmin01 awx]$ systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running)
Docs: https://docs.docker.com
Main PID: 31963 (dockerd)
Tasks: 204
Memory: 596.9M
CGroup: /system.slice/docker.service

hi,

I met the same problem while install AWX using local docker mode.

Here is the detail:

—> Running in 64dcba513948

npm --prefix awx/ui_next --loglevel warn --ignore-scripts install

npm WARN deprecated @babel/polyfill@7.12.1: ??? This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.

npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)

npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.

npm WARN deprecated eslint-loader@3.0.3: This loader has been deprecated. Please use eslint-webpack-plugin

npm WARN deprecated fsevents@2.1.2: “Please update to latest v2.3 or v2.2”

npm WARN deprecated html-webpack-plugin@4.0.0-beta.11: please switch to a stable version

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

npm WARN deprecated querystring@0.2.0: The

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

npm WARN deprecated @hapi/joi@15.1.1: Switch to ‘npm install joi’

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.

npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/address@2.1.4: Moved to ‘npm install @sideway/address’

npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()

npm WARN @lingui/cli@2.9.2 requires a peer of typescript@2 || 3 || 4 but none is installed. You must install peer dependencies yourself.

npm WARN eslint-config-airbnb@17.1.1 requires a peer of eslint@^4.19.1 || ^5.3.0 but none is installed. You must install peer dependencies yourself.

npm WARN eslint-config-airbnb-base@13.2.0 requires a peer of eslint@^4.19.1 || ^5.3.0 but none is installed. You must install peer dependencies yourself.

npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/chokidar/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

added 1986 packages from 1820 contributors in 69.156s

125 packages are looking for funding

run npm fund for details

npm --prefix awx/ui_next --loglevel warn run extract-strings

ui_next@0.1.0 extract-strings /tmp/src/awx/ui_next

lingui extract

No locales defined!

(use “npm --prefix awx/ui_next --loglevel warn run add-locale ” to add one)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! ui_next@0.1.0 extract-strings: lingui extract

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the ui_next@0.1.0 extract-strings script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! /root/.npm/_logs/2021-10-18T11_54_17_746Z-debug.log

make: *** [Makefile:481: awx/ui_next/.ui-built] Error 1

The command ‘/bin/sh -c make sdist && /var/lib/awx/venv/awx/bin/pip install dist/awx-$(cat VERSION).tar.gz’ returned a non-zero code: 2

I also read the log, but I did not find any useful information.

Thanks a lot if you can give me some suggestions to solve these problems.

在2021年1月7日星期四 UTC+8 上午12:48:10 写道: