Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The docker image of faraday missing entrypoint.sh #490

Open
Pad0y opened this issue Mar 26, 2024 · 4 comments
Open

The docker image of faraday missing entrypoint.sh #490

Pad0y opened this issue Mar 26, 2024 · 4 comments

Comments

@Pad0y
Copy link

Pad0y commented Mar 26, 2024

Please search the Wiki for a solution before posting a ticket. Use the “New Support Request” button to the right of the screen to submit a ticket for technical support.

Issue Type

  • Bug Re port

Faraday version

5.2.1

Component Name

If you know where the problem lays indicate it:
WebGui/GTKGui/Plugin/Console/Continuous Scanning/Etc.

Steps to reproduce

docker-compose up -d 

The startup command was executed and the following error was generated, so I think the image may not have been built well.

Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/entrypoint.sh": stat /entrypoint.sh: no such file or directory: unknown
@ezk06eer
Copy link

@Pad0y thanks for trying faraday!

We tested the docker-compose and no issues here:

image Beforehand, delete **any volumes associated and also pull a fresh image** when doing so. Also please `mv $HOME/.faraday $HOME/.faraday-bkp`

can you please share the entire output?
also:
docker image ls

the latest image id should be cff58b10bafe

From what is see it seems more a conflicting docker install than a broken image.

try this and let us know:

https://docs.docker.com/engine/install/ubuntu/#uninstall-old-versions

@Pad0y
Copy link
Author

Pad0y commented Mar 26, 2024

Thank you very much for your reply. I found that the md5 mirror is inconsistent with what you provided. Perhaps it is a network problem. Now I can pull the mirror and start it normally, but there are still some problems.

Attaching to faraday_redis, faraday_db, faraday_app
app_1    | Tue Mar 26 13:53:51 UTC 2024 Using existing server.ini
db_1     |
db_1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1     |
db_1     | 2024-03-26 13:53:51.103 UTC [1] LOG:  starting PostgreSQL 12.7 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit
db_1     | 2024-03-26 13:53:51.103 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1     | 2024-03-26 13:53:51.104 UTC [1] LOG:  listening on IPv6 address "::", port 5432
redis_1  | 1:C 26 Mar 2024 13:53:50.943 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1  | 1:C 26 Mar 2024 13:53:50.944 # Redis version=6.2.14, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1  | 1:C 26 Mar 2024 13:53:50.944 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1  | 1:M 26 Mar 2024 13:53:50.944 * monotonic clock: POSIX clock_gettime
db_1     | 2024-03-26 13:53:51.110 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1     | 2024-03-26 13:53:51.129 UTC [20] LOG:  database system was shut down at 2024-03-26 13:51:49 UTC
redis_1  | 1:M 26 Mar 2024 13:53:50.944 * Running mode=standalone, port=6379.
db_1     | 2024-03-26 13:53:51.133 UTC [1] LOG:  database system is ready to accept connections
redis_1  | 1:M 26 Mar 2024 13:53:50.944 # Server initialized
redis_1  | 1:M 26 Mar 2024 13:53:50.944 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1  | 1:M 26 Mar 2024 13:53:50.945 * Loading RDB produced by version 6.2.14
redis_1  | 1:M 26 Mar 2024 13:53:50.945 * RDB age 121 seconds
redis_1  | 1:M 26 Mar 2024 13:53:50.945 * RDB memory usage when created 0.77 Mb
redis_1  | 1:M 26 Mar 2024 13:53:50.945 # Done loading RDB, keys loaded: 0, keys expired: 0.
redis_1  | 1:M 26 Mar 2024 13:53:50.945 * DB loaded from disk: 0.000 seconds
redis_1  | 1:M 26 Mar 2024 13:53:50.945 * Ready to accept connections
app_1    | Update swagger...
app_1    | 2024-03-26T13:56:07+0000 - faraday.server.websockets.dispatcher - WARNING {MainThread} [pid:9] [dispatcher.py:54 - remove_sid()]  Could not update agents table. (psycopg2.OperationalError) could not connect to server: Connection timed out
app_1    | 	Is the server running on host "db" (172.20.0.3) and accepting
app_1    | 	TCP/IP connections on port 5432?
app_1    |
app_1    | (Background on this error at: http://sqlalche.me/e/13/e3q8)
app_1    | /usr/local/lib/python3.8/site-packages/apispec/ext/marshmallow/openapi.py:135: UserWarning: Multiple schemas resolved to the name Service. The name has been modified. Either manually add each of the schemas with a different name or provide a custom schema_name_resolver.
app_1    |   name = get_unique_schema_name(self.spec.components, name)
app_1    | /usr/local/lib/python3.8/site-packages/apispec/ext/marshmallow/common.py:65: UserWarning: Only explicitly-declared fields will be included in the Schema Object. Fields defined in Meta.fields or Meta.additional are ignored.
app_1    |   warn_if_fields_defined_in_meta(fields, Meta)
app_1    | Tue Mar 26 13:56:09 UTC 2024 Running migrations ...
app_1    | 2024-03-26T13:58:20+0000 - faraday.server.websockets.dispatcher - WARNING {MainThread} [pid:15] [dispatcher.py:54 - remove_sid()]  Could not update agents table. (psycopg2.OperationalError) could not connect to server: Connection timed out
app_1    | 	Is the server running on host "db" (172.20.0.3) and accepting
app_1    | 	TCP/IP connections on port 5432?
app_1    |
app_1    | (Background on this error at: http://sqlalche.me/e/13/e3q8)

I have opened all the corresponding ports in the firewall, but it still seems that the connection is unsuccessful. In addition, the log shows that db has an abnormal shutdown. I am not sure what happened. and I have deleted the. faraday directory and recreated the container.
image
This is the yaml file,the difference is that the default db location is modified to use a custom mount location.

version: '3.8'
services:
  db:
    image: postgres:12.7-alpine
    restart: always
    container_name: faraday_db
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=faraday
    ports:
      - '5432'
    volumes:
      - "/docker/faraday/pgdata:/var/lib/postgresql/data:rw"
  redis:
    image: 'redis:6.2-alpine'
    container_name: faraday_redis
    ports:
      - '6379'
  app:
    image: index.docker.io/faradaysec/faraday
    restart: always
    container_name: faraday_app
    entrypoint: "/entrypoint.sh"
    volumes:
     - "$HOME/.faraday:/home/faraday/.faraday:rw"
    environment:
      - PGSQL_USER=postgres
      - PGSQL_PASSWD=postgres
      - PGSQL_HOST=db
      - PGSQL_DBNAME=faraday
      - REDIS_SERVER=redis
    depends_on:
     - db
     - redis
    ports:
     - "5985:5985"

@ezk06eer
Copy link

Hi your docker-compose is not healty, it seems you modified it, the volume name is wrong it should be db:

can you please use the default?

cheers!

version: '3.8'
services:
  db:
    image: postgres:12.7-alpine
    restart: always
    container_name: faraday_db
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=faraday
    ports:
      - '5432'
    volumes:
      - "db:/var/lib/postgresql/data:rw"
  redis:
    image: 'redis:6.2-alpine'
    container_name: faraday_redis
    ports:
      - '6379'
  app:
    image: index.docker.io/faradaysec/faraday
    restart: always
    container_name: faraday_app
    entrypoint: "/entrypoint.sh"
    volumes:
     - "$HOME/.faraday:/home/faraday/.faraday:rw"
    environment:
      - PGSQL_USER=postgres
      - PGSQL_PASSWD=postgres
      - PGSQL_HOST=db
      - PGSQL_DBNAME=faraday
      - REDIS_SERVER=redis
    depends_on:
     - db
     - redis
    ports:
     - "5985:5985"
volumes:
  db:
    driver: local

@Pad0y
Copy link
Author

Pad0y commented Mar 26, 2024

It looks like the same problem,It seems to have the same problem. I will find another machine to re-test it tomorrow. Maybe the problem is not in the mirror image...I can try to rebuild the image myself and maybe it will work. Anyway, thank you very much for your patience.
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants