Closed mhmd-git closed 1 year ago
any update on this, encountered this today as well
No updates yet
Can you try
VERSION=develop docker-compose -f docker-compose.yml pull
and then
VERSION=develop docker-compose -f docker-compose.yml --compatibility up -d
Locally present images might be outdated.
this one produced crapi-workshop unhealthy
┌──(root㉿kali)-[~/API_Lab/crapi] └─# VERSION=develop docker-compose -f docker-compose.yml pull Pulling postgresdb ... done Pulling mongodb ... done Pulling crapi-identity ... done Pulling crapi-community ... done Pulling crapi-workshop ... done Pulling crapi-web ... done Pulling mailhog ... done
┌──(root㉿kali)-[~/API_Lab/crapi] └─# VERSION=develop docker-compose -f docker-compose.yml --compatibility up -d Recreating postgresdb ... done Recreating mailhog ... done Starting mongodb ... done Recreating crapi-identity ... done Creating crapi-community ... done
ERROR: for crapi-workshop Container "a06e1aacd28e" is unhealthy. ERROR: Encountered errors while bringing up the project.
docker logs a06e1aacd28e
Loading default JWKS file.
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.6.1)
2023-01-11 14:59:32.970 INFO 8 --- [ main] com.crapi.CRAPIBootApplication : Starting CRAPIBootApplication using Java 11.0.15 on a06e1aacd28e with PID 8 (/app/identity-service-1.0-SNAPSHOT.jar started by root in /) 2023-01-11 14:59:32.976 INFO 8 --- [ main] com.crapi.CRAPIBootApplication : No active profile set, falling back to default profiles: default 2023-01-11 14:59:37.274 INFO 8 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2023-01-11 14:59:37.575 INFO 8 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 291 ms. Found 8 JPA repository interfaces. 2023-01-11 14:59:40.695 INFO 8 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2023-01-11 14:59:40.777 INFO 8 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2023-01-11 14:59:40.778 INFO 8 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.55] 2023-01-11 14:59:40.967 INFO 8 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2023-01-11 14:59:40.967 INFO 8 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 7600 ms 2023-01-11 14:59:41.170 WARN 8 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2023-01-11 14:59:41.683 INFO 8 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2023-01-11 14:59:42.073 INFO 8 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.1.Final 2023-01-11 14:59:43.083 INFO 8 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2023-01-11 14:59:43.488 INFO 8 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2023-01-11 14:59:45.282 ERROR 8 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
org.postgresql.util.PSQLException: FATAL: database "crapi" does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676) ~[postgresql-42.4.0.jar!/:42.4.0]
at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2788) ~[postgresql-42.4.0.jar!/:42.4.0]
at org.postgresql.core.v3.QueryExecutorImpl.
Could you attach the logs of all containers, this will help us debug the issue. Also do upload the logs as a file.
Hopefully this helps
The error says that there is some issue connecting with the database, most probably postgres container did not come up because of old docker-comopse files.
docker container rm
commanddocker volume rm
command, probably will be named like this, use docker volume ls
to find them
docker_mongodb-data
docker_postgresql-data
And then try running it once more?
We have success...I had to stop all docker containers and I removed them all from my system, then I also stopped all docker volumes and removed them as well. Redownloaded CRAPI, and no errors.
docker container stop mongodb docker container rm mongodb
docker volume ls DRIVER VOLUME NAME local 9ae75f973c5868ca7e0b86eae352e3a53e449bdf2101d3881eeaf412ed91b8cd local a0a748cb16e9572a46d2bbbbf47fe1271715cff539ca314aaa02e4c95c753640 local crapi_mongodb-data local crapi_postgresql-data
docker volume rm crapi_mongodb-data
docker ps -aq f349b59bca37 a06e1aacd28e affdbaf1f293 93ac1ffa2788
docker rm f349b59bca37 docker rm a06e1aacd28e docker stop affdbaf1f293 docker rm affdbaf1f293 docker stop 93ac1ffa2788 docker rm 93ac1ffa2788
docker volume ls DRIVER VOLUME NAME local 9ae75f973c5868ca7e0b86eae352e3a53e449bdf2101d3881eeaf412ed91b8cd local a0a748cb16e9572a46d2bbbbf47fe1271715cff539ca314aaa02e4c95c753640 local crapi_postgresql-data
docker volume rm crapi_postgresql-data docker volume rm 9ae75f973c5868ca7e0b86eae352e3a53e449bdf2101d3881eeaf412ed91b8cd docker volume rm a0a748cb16e9572a46d2bbbbf47fe1271715cff539ca314aaa02e4c95c753640
curl -o docker-compose.yml https://raw.githubusercontent.com/OWASP/crAPI/develop/deploy/docker/docker-compose.yml % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6209 100 6209 0 0 1125 0 0:00:05 0:00:05 --:--:-- 1511
┌──(root㉿kali)-[~/API_Lab] └─# VERSION=develop docker-compose pull
Pulling postgresdb ... done Pulling mongodb ... done Pulling crapi-identity ... done Pulling crapi-community ... done Pulling crapi-workshop ... done Pulling crapi-web ... done Pulling mailhog ... done
┌──(root㉿kali)-[~/API_Lab] └─# VERSION=develop docker-compose -f docker-compose.yml --compatibility up -d Creating network "api_lab_default" with the default driver Creating volume "api_lab_mongodb-data" with default driver Creating volume "api_lab_postgresql-data" with default driver Creating mailhog ... done Creating mongodb ... done Creating postgresdb ... done Creating crapi-identity ... done Creating crapi-community ... done Creating crapi-workshop ... done Creating crapi-web ... done
that was not helpful vagrant documentation is totally inaccurate
Hey, I had the same issue: where crapi-web had an error, though managed to use the "restart" command
──(kali㉿kali)-[~/Labs/crAPI] └─$ sudo docker-compose start Starting postgresdb ... done Starting mongodb ... done Starting crapi-identity ... done Starting crapi-community ... done Starting crapi-workshop ... done Starting crapi-web ... error Starting mailhog ... done Starting api.crapi.io ... done
ERROR: for crapi-web Container "74f550385d99" is unhealthy.
api.crapi.io /app/server Up (unhealthy) 443/tcp
crapi-community /bin/sh -c /app/main Up (healthy)
crapi-identity /entrypoint.sh Up (healthy)
crapi-web /bin/sh -c /etc/nginx/ngin ... Exit 255 127.0.0.1:8888->80/tcp
crapi-workshop /bin/sh -c /app/runner.sh Exit 0
mailhog MailHog Up (healthy) 1025/tcp, 127.0.0.1:8025->8025/tcp
mongodb docker-entrypoint.sh mongod Up (healthy) 27017/tcp
postgresdb docker-entrypoint.sh postgres Up (healthy) 5432/tcp
┌──(kali㉿kali)-[~/Labs/crAPI] └─$
┌──(kali㉿kali)-[~/Labs/crAPI] └─$ sudo docker-compose restart Restarting crapi-web ... done Restarting crapi-workshop ... done Restarting crapi-community ... done Restarting crapi-identity ... done Restarting mailhog ... done Restarting mongodb ... done Restarting postgresdb ... done Restarting api.crapi.io ... done
I'm pulling the latest docker images in Kali-Linux then running:
docker-compose -f docker-compose.yml --compatibility up -d
I receive the following response:Logs: