docker-library / mongo

Docker Official Image packaging for MongoDB
https://www.mongodb.org/
Apache License 2.0
1.03k stars 619 forks source link

Can't connect apps to MongoDB inside docker in Linux #684

Closed Zabrell closed 4 months ago

Zabrell commented 4 months ago

I'm using a VM on DigitalOcean with Ubuntu 23.10 x64 on board. When deploying docker-compose I get authorization errors when connecting to the database:

"Supported SASL mechanisms requested for unknown user" "Failed to authenticate","attr":{"client":"172.18.0.2:59790","isSpeculative":true,"isClusterMember":false,"mechanism":"SCRAM-SHA-256","user":"maria","db":"admin","error":"UserNotFound: Could not find user \"maria\" for db \"admin\""

When building from under Windows this problem is not present (the database is not installed locally either, everything is only inside the containers), and I can't understand what the problem is I have already tried everything that has been advised on the Internet, including initializing the database and user with a script during the build - all the same failures What is the problem if the images are identical, the containers are identical, but in one case the user(MONGO_ROOT_USERNAME) is created and located, but in the other case it is not?

My docker-compose:

version: "3.8"
networks:
  sales_bot_network:
    driver: bridge
services:
  db:
    container_name: db
    env_file:
      - .env
    networks:
      - sales_bot_network
    image: mongo:7
    volumes:
      - mongodb_data_container:/data/db
    ports:
      - "28017:27017"
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
    restart: unless-stopped

  db-admin:
    container_name: db-admin
    env_file:
      - .env
    networks:
      - sales_bot_network
    image: mongo-express
    ports:
      - "8081:8081"
    environment:
      - ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGO_ROOT_USERNAME}
      - ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGO_ROOT_PASSWORD}
      - ME_CONFIG_MONGODB_SERVER=db
      - ME_CONFIG_MONGODB_URL=mongodb://${MONGO_ROOT_USERNAME}:${MONGO_ROOT_PASSWORD}@db:27017/?authSource=admin
      - ME_CONFIG_SITE_BASEURL=/db-admin
      - ME_CONFIG_MONGODB_ENABLE_ADMIN=true
      - ME_CONFIG_BASICAUTH_USERNAME=${MONGO_EXPRESS_USERNAME}
      - ME_CONFIG_BASICAUTH_PASSWORD=${MONGO_EXPRESS_PASSWORD}
    restart: unless-stopped

  bot:
    container_name: bot
    networks:
      - sales_bot_network
    build:
      context: .
      dockerfile: ./bot.Dockerfile
    depends_on:
      - db
    env_file:
      - .env
    environment:
      - DATABASE_URL=mongodb://${MONGO_ROOT_USERNAME}:${MONGO_ROOT_PASSWORD}@db:27017/db?authSource=admin
    restart: unless-stopped

volumes:
  mongodb_data_container:

The .env contains:

# Database URL — will be overriden by docker-compose.yml anyway
DATABASE_URL="mongodb://localhost:27017"

# Docker MongoDB logopass
MONGO_ROOT_USERNAME="maria"
MONGO_ROOT_PASSWORD="blablabla"

# Docker Mongo Express logopass
MONGO_EXPRESS_USERNAME="maria"
MONGO_EXPRESS_PASSWORD="blablabla" 
DB container logs in Ubuntu VM(Docker version 26.0.1, build d260a54) ``` {"t":{"$date":"2024-04-17T11:05:09.380+00:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"main","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":21},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":21},"outgoing":{"minWireVersion":6,"maxWireVersion":21},"isInternalClient":true}}} {"t":{"$date":"2024-04-17T11:05:09.385+00:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"} {"t":{"$date":"2024-04-17T11:05:09.387+00:00"},"s":"I", "c":"NETWORK", "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."} {"t":{"$date":"2024-04-17T11:05:09.391+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.tenantMigrationDonors"}} {"t":{"$date":"2024-04-17T11:05:09.392+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"config.tenantMigrationRecipients"}} {"t":{"$date":"2024-04-17T11:05:09.392+00:00"},"s":"I", "c":"CONTROL", "id":5945603, "ctx":"main","msg":"Multi threading initialized"} {"t":{"$date":"2024-04-17T11:05:09.392+00:00"},"s":"I", "c":"TENANT_M", "id":7091600, "ctx":"main","msg":"Starting TenantMigrationAccessBlockerRegistry"} {"t":{"$date":"2024-04-17T11:05:09.392+00:00"},"s":"I", "c":"CONTROL", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"74e8ce1a361d"}} {"t":{"$date":"2024-04-17T11:05:09.393+00:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"7.0.8","gitVersion":"c5d33e55ba38d98e2f48765ec4e55338d67a4a64","openSSLVersion":"OpenSSL 3.0.2 15 Mar 2022","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2204","distarch":"x86_64","target_arch":"x86_64"}}}} {"t":{"$date":"2024-04-17T11:05:09.393+00:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"22.04"}}} {"t":{"$date":"2024-04-17T11:05:09.393+00:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"},"security":{"authorization":"enabled"}}}} {"t":{"$date":"2024-04-17T11:05:09.396+00:00"},"s":"I", "c":"STORAGE", "id":22270, "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/data/db","storageEngine":"wiredTiger"}} {"t":{"$date":"2024-04-17T11:05:09.397+00:00"},"s":"I", "c":"STORAGE", "id":22297, "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]} {"t":{"$date":"2024-04-17T11:05:09.398+00:00"},"s":"I", "c":"STORAGE", "id":22315, "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=467M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,remove=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rts:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],"}} {"t":{"$date":"2024-04-17T11:05:10.919+00:00"},"s":"I", "c":"STORAGE", "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":1521}} {"t":{"$date":"2024-04-17T11:05:10.919+00:00"},"s":"I", "c":"RECOVERY", "id":23987, "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}} {"t":{"$date":"2024-04-17T11:05:10.952+00:00"},"s":"W", "c":"CONTROL", "id":5123300, "ctx":"initandlisten","msg":"vm.max_map_count is too low","attr":{"currentValue":65530,"recommendedMinimum":1677720,"maxConns":838860},"tags":["startupWarnings"]} {"t":{"$date":"2024-04-17T11:05:10.960+00:00"},"s":"I", "c":"NETWORK", "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":21},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":21},"outgoing":{"minWireVersion":6,"maxWireVersion":21},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":21},"incomingInternalClient":{"minWireVersion":21,"maxWireVersion":21},"outgoing":{"minWireVersion":21,"maxWireVersion":21},"isInternalClient":true}}} {"t":{"$date":"2024-04-17T11:05:10.961+00:00"},"s":"I", "c":"REPL", "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"7.0","context":"startup"}} {"t":{"$date":"2024-04-17T11:05:10.961+00:00"},"s":"I", "c":"STORAGE", "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"} {"t":{"$date":"2024-04-17T11:05:10.981+00:00"},"s":"I", "c":"CONTROL", "id":6608200, "ctx":"initandlisten","msg":"Initializing cluster server parameters from disk"} {"t":{"$date":"2024-04-17T11:05:10.982+00:00"},"s":"I", "c":"CONTROL", "id":20536, "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"} {"t":{"$date":"2024-04-17T11:05:10.982+00:00"},"s":"I", "c":"FTDC", "id":20625, "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}} {"t":{"$date":"2024-04-17T11:05:11.004+00:00"},"s":"I", "c":"REPL", "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}} {"t":{"$date":"2024-04-17T11:05:11.005+00:00"},"s":"I", "c":"STORAGE", "id":22262, "ctx":"initandlisten","msg":"Timestamp monitor starting"} {"t":{"$date":"2024-04-17T11:05:11.021+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}} {"t":{"$date":"2024-04-17T11:05:11.022+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}} {"t":{"$date":"2024-04-17T11:05:11.022+00:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}} {"t":{"$date":"2024-04-17T11:05:11.022+00:00"},"s":"I", "c":"CONTROL", "id":8423403, "ctx":"initandlisten","msg":"mongod startup complete","attr":{"Summary of time elapsed":{"Startup from clean shutdown?":true,"Statistics":{"Transport layer setup":"0 ms","Run initial syncer crash recovery":"0 ms","Create storage engine lock file in the data directory":"0 ms","Get metadata describing storage engine":"0 ms","Validate options in metadata against current startup options":"0 ms","Create storage engine":"1544 ms","Write current PID to file":"10 ms","Initialize FCV before rebuilding indexes":"9 ms","Drop abandoned idents and get back indexes that need to be rebuilt or builds that need to be restarted":"0 ms","Rebuild indexes for collections":"0 ms","Load cluster parameters from disk for a standalone":"1 ms","Build user and roles graph":"0 ms","Set up the background thread pool responsible for waiting for opTimes to be majority committed":"1 ms","Initialize information needed to make a mongod instance shard aware":"0 ms","Start up the replication coordinator":"3 ms","Start transport layer":"2 ms","_initAndListen total elapsed time":"1630 ms"}}}} {"t":{"$date":"2024-04-17T11:05:11.749+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.2:33956","uuid":{"uuid":{"$uuid":"40d5dbfa-b241-437f-97a7-fdfb3a1a5839"}},"connectionId":1,"connectionCount":1}} {"t":{"$date":"2024-04-17T11:05:11.752+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn1","msg":"Connection ended","attr":{"remote":"172.18.0.2:33956","uuid":{"uuid":{"$uuid":"40d5dbfa-b241-437f-97a7-fdfb3a1a5839"}},"connectionId":1,"connectionCount":0}} {"t":{"$date":"2024-04-17T11:05:15.309+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.2:59774","uuid":{"uuid":{"$uuid":"2e66da57-67d1-40e8-aebd-83392fc3b481"}},"connectionId":2,"connectionCount":1}} {"t":{"$date":"2024-04-17T11:05:15.326+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn2","msg":"client metadata","attr":{"remote":"172.18.0.2:59774","client":"conn2","negotiatedCompressors":[],"doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"6.5.0-27-generic"},"platform":"Node.js v18.20.2, LE (unified)|Node.js v18.20.2, LE (unified)"}}} {"t":{"$date":"2024-04-17T11:05:15.347+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.2:59790","uuid":{"uuid":{"$uuid":"a1b23066-e4ce-41e9-ba46-98c459f3033c"}},"connectionId":3,"connectionCount":2}} {"t":{"$date":"2024-04-17T11:05:15.353+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn3","msg":"client metadata","attr":{"remote":"172.18.0.2:59790","client":"conn3","negotiatedCompressors":[],"doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"6.5.0-27-generic"},"platform":"Node.js v18.20.2, LE (unified)|Node.js v18.20.2, LE (unified)"}}} {"t":{"$date":"2024-04-17T11:05:15.354+00:00"},"s":"I", "c":"ACCESS", "id":20251, "ctx":"conn3","msg":"Supported SASL mechanisms requested for unknown user","attr":{"user":{"user":"maria","db":"admin"}}} {"t":{"$date":"2024-04-17T11:05:15.354+00:00"},"s":"I", "c":"ACCESS", "id":6788604, "ctx":"conn3","msg":"Auth metrics report","attr":{"metric":"acquireUser","micros":0}} {"t":{"$date":"2024-04-17T11:05:15.354+00:00"},"s":"I", "c":"ACCESS", "id":5286307, "ctx":"conn3","msg":"Failed to authenticate","attr":{"client":"172.18.0.2:59790","isSpeculative":true,"isClusterMember":false,"mechanism":"SCRAM-SHA-256","user":"maria","db":"admin","error":"UserNotFound: Could not find user \"maria\" for db \"admin\"","result":11,"metrics":{"conversation_duration":{"micros":166,"summary":{"0":{"step":1,"step_total":2,"duration_micros":144}}}},"extraInfo":{}}} {"t":{"$date":"2024-04-17T11:05:15.357+00:00"},"s":"I", "c":"ACCESS", "id":6788604, "ctx":"conn3","msg":"Auth metrics report","attr":{"metric":"acquireUser","micros":0}} {"t":{"$date":"2024-04-17T11:05:15.357+00:00"},"s":"I", "c":"ACCESS", "id":5286307, "ctx":"conn3","msg":"Failed to authenticate","attr":{"client":"172.18.0.2:59790","isSpeculative":false,"isClusterMember":false,"mechanism":"SCRAM-SHA-1","user":"maria","db":"admin","error":"UserNotFound: Could not find user \"maria\" for db \"admin\"","result":11,"metrics":{"conversation_duration":{"micros":240,"summary":{"0":{"step":1,"step_total":2,"duration_micros":221}}}},"extraInfo":{}}} {"t":{"$date":"2024-04-17T11:05:15.376+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn2","msg":"Connection ended","attr":{"remote":"172.18.0.2:59774","uuid":{"uuid":{"$uuid":"2e66da57-67d1-40e8-aebd-83392fc3b481"}},"connectionId":2,"connectionCount":1}} ```
Remote connections are the same: ``` {"t":{"$date":"2024-04-17T14:38:28.587+00:00"},"s":"I", "c":"ACCESS", "id":6788604, "ctx":"conn64","msg":"Auth metrics report","attr":{"metric":"acquireUser","micros":0}} {"t":{"$date":"2024-04-17T14:38:28.588+00:00"},"s":"I", "c":"ACCESS", "id":5286307, "ctx":"conn64","msg":"Failed to authenticate","attr":{"client":"128.***.240.205:63672","isSpeculative":true,"isClusterMember":false,"mechanism":"SCRAM-SHA-256","user":"maria","db":"admin","error":"UserNotFound: Could not find user \"maria\" for db \"admin\"","result":11,"metrics":{"conversation_duration":{"micros":433,"summary":{"0":{"step":1,"step_total":2,"duration_micros":391}}}},"extraInfo":{}}} {"t":{"$date":"2024-04-17T14:38:28.664+00:00"},"s":"I", "c":"ACCESS", "id":6788604, "ctx":"conn64","msg":"Auth metrics report","attr":{"metric":"acquireUser","micros":0}} {"t":{"$date":"2024-04-17T14:38:28.665+00:00"},"s":"I", "c":"ACCESS", "id":5286307, "ctx":"conn64","msg":"Failed to authenticate","attr":{"client":"128.***.240.205:63672","isSpeculative":false,"isClusterMember":false,"mechanism":"SCRAM-SHA-1","user":"maria","db":"admin","error":"UserNotFound: Could not find user \"maria\" for db \"admin\"","result":11,"metrics":{"conversation_duration":{"micros":685,"summary":{"0":{"step":1,"step_total":2,"duration_micros":635}}}},"extraInfo":{}}} ```
DB container logs in Windows(Docker version 25.0.3, build 4debf41) ``` 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.629+00:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"main","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":21},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":21},"outgoing":{"minWireVersion":6,"maxWireVersion":21},"isInternalClient":true}}} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.629+00:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.630+00:00"},"s":"I", "c":"NETWORK", "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.631+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.tenantMigrationDonors"}} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.631+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"config.tenantMigrationRecipients"}} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.631+00:00"},"s":"I", "c":"CONTROL", "id":5945603, "ctx":"main","msg":"Multi threading initialized"} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.631+00:00"},"s":"I", "c":"TENANT_M", "id":7091600, "ctx":"main","msg":"Starting TenantMigrationAccessBlockerRegistry"} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.631+00:00"},"s":"I", "c":"CONTROL", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"ee958b795205"}} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.631+00:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"7.0.8","gitVersion":"c5d33e55ba38d98e2f48765ec4e55338d67a4a64","openSSLVersion":"OpenSSL 3.0.2 15 Mar 2022","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2204","distarch":"x86_64","target_arch":"x86_64"}}}} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.631+00:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"22.04"}}} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.631+00:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"},"security":{"authorization":"enabled"}}}} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.632+00:00"},"s":"I", "c":"STORAGE", "id":22270, "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/data/db","storageEngine":"wiredTiger"}} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.632+00:00"},"s":"I", "c":"STORAGE", "id":22297, "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]} 2024-04-17 15:10:56 {"t":{"$date":"2024-04-17T11:10:56.632+00:00"},"s":"I", "c":"STORAGE", "id":22315, "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=7388M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,remove=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rts:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],"}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.343+00:00"},"s":"I", "c":"STORAGE", "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":711}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.343+00:00"},"s":"I", "c":"RECOVERY", "id":23987, "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.365+00:00"},"s":"W", "c":"CONTROL", "id":22178, "ctx":"initandlisten","msg":"/sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never' in this binary version","tags":["startupWarnings"]} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.365+00:00"},"s":"W", "c":"CONTROL", "id":5123300, "ctx":"initandlisten","msg":"vm.max_map_count is too low","attr":{"currentValue":262144,"recommendedMinimum":1677720,"maxConns":838860},"tags":["startupWarnings"]} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.367+00:00"},"s":"I", "c":"NETWORK", "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":21},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":21},"outgoing":{"minWireVersion":6,"maxWireVersion":21},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":21},"incomingInternalClient":{"minWireVersion":21,"maxWireVersion":21},"outgoing":{"minWireVersion":21,"maxWireVersion":21},"isInternalClient":true}}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.367+00:00"},"s":"I", "c":"REPL", "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"7.0","context":"startup"}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.367+00:00"},"s":"I", "c":"STORAGE", "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.370+00:00"},"s":"I", "c":"CONTROL", "id":6608200, "ctx":"initandlisten","msg":"Initializing cluster server parameters from disk"} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.370+00:00"},"s":"I", "c":"CONTROL", "id":20536, "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.370+00:00"},"s":"I", "c":"FTDC", "id":20625, "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.373+00:00"},"s":"I", "c":"REPL", "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.373+00:00"},"s":"I", "c":"STORAGE", "id":22262, "ctx":"initandlisten","msg":"Timestamp monitor starting"} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.374+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.374+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.374+00:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.374+00:00"},"s":"I", "c":"CONTROL", "id":8423403, "ctx":"initandlisten","msg":"mongod startup complete","attr":{"Summary of time elapsed":{"Startup from clean shutdown?":true,"Statistics":{"Transport layer setup":"0 ms","Run initial syncer crash recovery":"0 ms","Create storage engine lock file in the data directory":"0 ms","Get metadata describing storage engine":"0 ms","Validate options in metadata against current startup options":"0 ms","Create storage engine":"722 ms","Write current PID to file":"10 ms","Initialize FCV before rebuilding indexes":"2 ms","Drop abandoned idents and get back indexes that need to be rebuilt or builds that need to be restarted":"0 ms","Rebuild indexes for collections":"0 ms","Load cluster parameters from disk for a standalone":"0 ms","Build user and roles graph":"0 ms","Verify indexes for admin.system.users collection":"0 ms","Set up the background thread pool responsible for waiting for opTimes to be majority committed":"0 ms","Initialize information needed to make a mongod instance shard aware":"0 ms","Start up the replication coordinator":"2 ms","Start transport layer":"1 ms","_initAndListen total elapsed time":"743 ms"}}}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.610+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.2:44678","uuid":{"uuid":{"$uuid":"2ddf9f1d-0555-4ce7-8367-834ee3a47e15"}},"connectionId":1,"connectionCount":1}} 2024-04-17 15:10:57 {"t":{"$date":"2024-04-17T11:10:57.610+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn1","msg":"Connection ended","attr":{"remote":"172.18.0.2:44678","uuid":{"uuid":{"$uuid":"2ddf9f1d-0555-4ce7-8367-834ee3a47e15"}},"connectionId":1,"connectionCount":0}} 2024-04-17 15:10:58 {"t":{"$date":"2024-04-17T11:10:58.122+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.2:44688","uuid":{"uuid":{"$uuid":"fa4ec3e0-7f32-444d-bf01-38f7d2d6a9cf"}},"connectionId":2,"connectionCount":1}} 2024-04-17 15:10:58 {"t":{"$date":"2024-04-17T11:10:58.125+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn2","msg":"client metadata","attr":{"remote":"172.18.0.2:44688","client":"conn2","negotiatedCompressors":[],"doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.15.146.1-microsoft-standard-WSL2"},"platform":"Node.js v18.20.2, LE (unified)|Node.js v18.20.2, LE (unified)"}}} 2024-04-17 15:10:58 {"t":{"$date":"2024-04-17T11:10:58.129+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.2:44692","uuid":{"uuid":{"$uuid":"ab210ea6-9169-4536-88e6-9b6ae190f7ed"}},"connectionId":3,"connectionCount":2}} 2024-04-17 15:10:58 {"t":{"$date":"2024-04-17T11:10:58.130+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn3","msg":"client metadata","attr":{"remote":"172.18.0.2:44692","client":"conn3","negotiatedCompressors":[],"doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.15.146.1-microsoft-standard-WSL2"},"platform":"Node.js v18.20.2, LE (unified)|Node.js v18.20.2, LE (unified)"}}} 2024-04-17 15:10:58 {"t":{"$date":"2024-04-17T11:10:58.132+00:00"},"s":"I", "c":"ACCESS", "id":6788604, "ctx":"conn3","msg":"Auth metrics report","attr":{"metric":"acquireUser","micros":0}} 2024-04-17 15:10:58 {"t":{"$date":"2024-04-17T11:10:58.138+00:00"},"s":"I", "c":"ACCESS", "id":5286306, "ctx":"conn3","msg":"Successfully authenticated","attr":{"client":"172.18.0.2:44692","isSpeculative":true,"isClusterMember":false,"mechanism":"SCRAM-SHA-256","user":"maria","db":"admin","result":0,"metrics":{"conversation_duration":{"micros":5944,"summary":{"0":{"step":1,"step_total":2,"duration_micros":38},"1":{"step":2,"step_total":2,"duration_micros":22}}}},"extraInfo":{}}} 2024-04-17 15:10:58 {"t":{"$date":"2024-04-17T11:10:58.139+00:00"},"s":"I", "c":"NETWORK", "id":6788700, "ctx":"conn3","msg":"Received first command on ingress connection since session start or auth handshake","attr":{"elapsedMillis":1}} 2024-04-17 15:11:01 {"t":{"$date":"2024-04-17T11:11:01.096+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.4:50620","uuid":{"uuid":{"$uuid":"fd9211b9-1959-4bb6-8e7c-026589bfd4ff"}},"connectionId":4,"connectionCount":3}} ```
Zabrell commented 4 months ago

Bot-app connected to db with python:

from pymongo import MongoClient
client: MongoClient = MongoClient(database_url)
Zabrell commented 4 months ago

I found what the problem is - a bug in the latest version of Docker Rolling back the version to 5:25.0.3-1~ubuntu.23.10~mantic, everything worked for me... Please fix this issue, I've provided maximum information.