68publishers / consent-management-platform

🛡 Easily manage user consents and the cookie widget
Other
32 stars 7 forks source link

v1.0 - make init errors #66

Open kolaps opened 8 months ago

kolaps commented 8 months ago

After exec - make init got errors:

  1. error /var/www/html/vendor does not exist and could not be created.
    
    docker exec -it cmp-app composer install --no-interaction --no-ansi --prefer-dist --no-progress --optimize-autoloader
    Installing dependencies from lock file (including require-dev)
    Verifying lock file contents can be installed on current platform.
    Package operations: 167 installs, 0 updates, 0 removals

In Filesystem.php line 254:

/var/www/html/vendor does not exist and could not be created.

to resolve issue create folder **vendor**
```mkdir vendor
chmod 777 vendor```

2. yarn error
```error Could not write file "/var/www/html/yarn-error.log": "EACCES: permission denied, open '/var/www/html/yarn-error.log'"
error An unexpected error occurred: "EACCES: permission denied, mkdir '/var/www/html/node_modules'".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

to resolve issue create folder node_modules

chmod 777 node_modules```

3. yarn error
```yarn run v1.22.19
warning package.json: License should be a valid SPDX license expression
$ /var/www/html/node_modules/.bin/encore prod
Running webpack ...

  Error: EACCES: permission denied, mkdir '/var/www/html/public/dist'

to resolve issue create folder dist

chmod 777 public/dist```

4. nette cache error
```make[2]: Leaving directory '/root/cmp'
# Duplicity with init
make data-migration
make[2]: Entering directory '/root/cmp'
docker exec -it cmp-app bin/console migrations:migrate --no-interaction
Nette\IOException: Unable to create directory '/var/www/html/var/cache' with mode 777. Permission denied in /var/www/html/vendor/nette/utils/src/Utils/FileSystem.php:29
Stack trace:
#0 /var/www/html/vendor/nette/bootstrap/src/Bootstrap/Configurator.php(351): Nette\Utils\FileSystem::createDir('/var/www/html/s...')
#1 /var/www/html/vendor/nette/bootstrap/src/Bootstrap/Configurator.php(278): Nette\Bootstrap\Configurator->getCacheDirectory()

also missing var/log & var/cache folder.. Have created missing folders & chmod 777..

Now is working https://prnt.sc/TN7rF-12-33c

tg666 commented 8 months ago

Hi The problem shouldn't be that some folders are missing (they are created automatically when needed), but rather the permissions. What system were you running this on (Mac OS, Linux, Win)?

rainje commented 8 months ago

Hi,

I have the same issue, running fresh debian 12.

Running make init as a user or with sudo gives the same result.

[16:05] rain@seth$ make init
make stop
make[1]: Entering directory '/home/rain/cmp'
docker compose --profile web --profile worker stop
make[1]: Leaving directory '/home/rain/cmp'
make db-clear
make[1]: Entering directory '/home/rain/cmp'
rm -rf var/postgres-data/*
make[1]: Leaving directory '/home/rain/cmp'
make start
make[1]: Entering directory '/home/rain/cmp'
docker compose --profile web up -d
[+] Running 3/4
 ⠼ Network cmp_backend  Created                                                                                                                                                                                                                                                         11.5s
 ✔ Container cmp-db     Healthy                                                                                                                                                                                                                                                         11.1s
 ✔ Container cmp-redis  Started                                                                                                                                                                                                                                                          0.6s
 ✔ Container cmp-app    Started                                                                                                                                                                                                                                                         11.3s
visit http://localhost:8888
make[1]: Leaving directory '/home/rain/cmp'
make install
make[1]: Entering directory '/home/rain/cmp'
make cache-clear
make[2]: Entering directory '/home/rain/cmp'
rm -rf var/cache/*
rm -rf var/log/*
rm -rf var/mail-panel-latte
make[2]: Leaving directory '/home/rain/cmp'
make install-composer
make[2]: Entering directory '/home/rain/cmp'
docker exec -it cmp-app composer install --no-interaction --no-ansi --prefer-dist --no-progress --optimize-autoloader
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 167 installs, 0 updates, 0 removals

In Filesystem.php line 254:

  /var/www/html/vendor does not exist and could not be created.

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

make[2]: *** [Makefile:87: install-composer] Error 1
make[2]: Leaving directory '/home/rain/cmp'
make[1]: *** [Makefile:81: install] Error 2
make[1]: Leaving directory '/home/rain/cmp'
make: *** [Makefile:97: init] Error 2
kolaps commented 8 months ago

Runing fresh Proxmox VM - Almalinux 8.9, git/docker installed. Yes same problems like @rainje

rainje commented 2 months ago

@kolaps Could you share your modified files? I guess the Makefile. Cheers.