Kitware / CDash

An open source, web-based software testing server
http://www.cdash.org/
Other
211 stars 76 forks source link

Fresh prod install through docker fails with npm ERR! Failed to access /var/www/.cache/Cypress #1951

Closed vlebourl closed 8 months ago

vlebourl commented 8 months ago

Bug report

Actual Behavior

Following the docker readme, the test install succeeds but the prod fails.

CDash Version

v3.2.1

Additional Information

Fresh Ubuntu Jammy on a KVM, docker is installed through the official Docker repository. I follow the readme to the letter, except for the APP_KEY where I copy the one given after the first attempt fails. Here's the log of the error on the second attempt:

[+] Running 2/0
 ✔ Container cdash_postgres  Created                                                                                                                                                                                                                                        0.0s 
 ✔ Container cdash           Created                                                                                                                                                                                                                                        0.0s 
Attaching to cdash, cdash_postgres, cdash_worker
cdash_postgres  | 
cdash_postgres  | PostgreSQL Database directory appears to contain a database; Skipping initialization
cdash_postgres  | 
cdash_postgres  | 2024-01-15 10:35:19.020 UTC [1] LOG:  starting PostgreSQL 16.1 (Debian 16.1-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
cdash_postgres  | 2024-01-15 10:35:19.020 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
cdash_postgres  | 2024-01-15 10:35:19.020 UTC [1] LOG:  listening on IPv6 address "::", port 5432
cdash_postgres  | 2024-01-15 10:35:19.023 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
cdash_postgres  | 2024-01-15 10:35:19.027 UTC [29] LOG:  database system was shut down at 2024-01-15 10:32:55 UTC
cdash_postgres  | 2024-01-15 10:35:19.038 UTC [1] LOG:  database system is ready to accept connections
cdash           | =================================================================================
cdash           | Beginning CDash installation...
cdash           | Enabling maintenance mode...
cdash           | 
cdash           |    INFO  Application is already down.  
cdash           | 
cdash           | Updating vendor dependencies...
cdash           | npm WARN deprecated har-validator@5.1.5: this library is no longer supported
cdash           | npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
cdash           | npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
cdash           | npm WARN deprecated protractor@7.0.0: We have news to share - Protractor is deprecated and will reach end-of-life by Summer 2023. To learn more and find out about other options please refer to this post on the Angular blog. Thank you for using and contributing to Protractor. https://goo.gle/state-of-e2e-in-angular
cdash           | npm ERR! code 1
cdash           | npm ERR! path /cdash/node_modules/cypress
cdash           | npm ERR! command failed
cdash           | npm ERR! command sh -c node index.js --exec install
cdash           | npm ERR! Cypress cannot write to the cache directory due to file permissions
cdash           | npm ERR! 
cdash           | npm ERR! See discussion and possible solutions at
cdash           | npm ERR! https://github.com/cypress-io/cypress/issues/1281
cdash           | npm ERR! 
cdash           | npm ERR! ----------
cdash           | npm ERR! 
cdash           | npm ERR! Failed to access /var/www/.cache/Cypress:
cdash           | npm ERR! 
cdash           | npm ERR! EACCES: permission denied, mkdir '/var/www/.cache'
cdash           | npm ERR! 
cdash           | npm ERR! ----------
cdash           | npm ERR! 
cdash           | npm ERR! Platform: linux-x64 (Debian - 12.4)
cdash           | npm ERR! Cypress Version: 13.6.2
cdash           | 
cdash           | npm ERR! A complete log of this run can be found in: /var/www/.npm/_logs/2024-01-15T10_35_21_402Z-debug-0.log
cdash           | 
cdash           | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cdash           | *                            INSTALLATION FAILURE!                            *
cdash           | *                                                                             *
cdash           | * An error occurred while installing CDash and CDash was not able to recover  *
cdash           | * automatically.  If you believe that this is a problem with CDash, please    *
cdash           | * report the error here:                                                      *
cdash           | *                                                                             *
cdash           | * -> https://github.com/Kitware/CDash/issues/new                              *
cdash           | *                                                                             *
cdash           | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cdash           | 
dependency failed to start: container cdash exited (1)
cdash exited with code 1

I haven't been able to find any way around this... Any help would be most welcome. Cheers

vlebourl commented 8 months ago

adding - /var/www:/var/www to the volumes in docker-compose.yaml and running sudo chown -R 33:33 "/var/www" makes me go one step beyond but I get the following now:

lebourlot@cdash:~/CDash$ docker compose --env-file .env     -f docker/docker-compose.yml     -f docker/docker-compose.production.yml     -f docker/docker-compose.postgres.yml     up
WARN[0000] The "PUSHER_APP_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_CLUSTER" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_CLUSTER" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_CLUSTER" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_CLUSTER" variable is not set. Defaulting to a blank string. 
[+] Running 2/0
 ✔ Container cdash_postgres  Running                                                                                                                                                                                                                                        0.0s 
 ✔ Container cdash           Created                                                                                                                                                                                                                                        0.0s 
Attaching to cdash, cdash_postgres, cdash_worker
cdash           | =================================================================================
cdash           | Beginning CDash installation...
cdash           | Enabling maintenance mode...
cdash           | 
cdash           |    INFO  Application is already down.  
cdash           | 
cdash           | Updating vendor dependencies...
cdash           | npm WARN deprecated har-validator@5.1.5: this library is no longer supported
cdash           | npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
cdash           | npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
cdash           | npm WARN deprecated protractor@7.0.0: We have news to share - Protractor is deprecated and will reach end-of-life by Summer 2023. To learn more and find out about other options please refer to this post on the Angular blog. Thank you for using and contributing to Protractor. https://goo.gle/state-of-e2e-in-angular
cdash           | 
cdash           | changed 536 packages, and audited 1443 packages in 18s
cdash           | 
cdash           | 135 packages are looking for funding
cdash           |   run `npm fund` for details
cdash           | npm notice 
cdash           | npm notice New minor version of npm available! 10.2.4 -> 10.3.0
cdash           | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.3.0>
cdash           | npm notice Run `npm install -g npm@10.3.0` to update!
cdash           | npm notice 
cdash           | 
cdash           | 9 moderate severity vulnerabilities
cdash           | 
cdash           | To address all issues (including breaking changes), run:
cdash           |   npm audit fix --force
cdash           | 
cdash           | Run `npm audit` for details.
cdash           | Installing dependencies from lock file (including require-dev)
cdash           | Verifying lock file contents can be installed on current platform.
cdash           | Your lock file does not contain a compatible set of packages. Please run composer update.
cdash           | 
cdash           |   Problem 1
cdash           |     - Root composer.json requires PHP extension ext-xdebug * but it is missing from your system. Install or enable PHP's xdebug extension.
cdash           | 
cdash           | To enable extensions, verify that they are enabled in your .ini files:
cdash           |     - /usr/local/etc/php/conf.d/cdash.ini
cdash           |     - /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini
cdash           |     - /usr/local/etc/php/conf.d/docker-php-ext-bz2.ini
cdash           |     - /usr/local/etc/php/conf.d/docker-php-ext-gd.ini
cdash           |     - /usr/local/etc/php/conf.d/docker-php-ext-ldap.ini
cdash           |     - /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini
cdash           |     - /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini
cdash           |     - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
cdash           |     - /usr/local/etc/php/conf.d/docker-php-ext-xsl.ini
cdash           | You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
cdash           | Alternatively, you can run Composer with `--ignore-platform-req=ext-xdebug` to temporarily ignore these required extensions.
cdash           | 
cdash           | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cdash           | *                            INSTALLATION FAILURE!                            *
cdash           | *                                                                             *
cdash           | * An error occurred while installing CDash and CDash was not able to recover  *
cdash           | * automatically.  If you believe that this is a problem with CDash, please    *
cdash           | * report the error here:                                                      *
cdash           | *                                                                             *
cdash           | * -> https://github.com/Kitware/CDash/issues/new                              *
cdash           | *                                                                             *
cdash           | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cdash           | 
dependency failed to start: container cdash exited (1)
williamjallen commented 8 months ago

This issue appears to be caused by #1893, which means that the issue does not affect any current releases. The cdash_install script erroneously installs dev dependencies in production images. I'll create a PR to fix this today.