# Use an official Golang runtime as a parent image
FROM golang:1.16
# Set the working directory inside the container
WORKDIR /app
# Copy the local package files to the container's workspace
COPY . .
# Build the Go application
RUN go build -o main .
# Expose port 8080
EXPOSE 8080
# Command to run the Go application
CMD ["./main"]
and replace line 21 in main.go as - client, err := New("mongoDb:27017", dbName)
Logs for keploy test command are -
2023/09/27 20:41:43 must use ASL logging (which requires CGO) if running as root
latest: Pulling from keploy/keploy
Digest: sha256:d592c1589e6acb3a2a8968c5ad6f53c53f0d23dbcbad8e5ebca8409f0f4c4325
Status: Image is up to date for ghcr.io/keploy/keploy:latest
▓██▓▄
▓▓▓▓██▓█▓▄
████████▓▒
▀▓▓███▄ ▄▄ ▄ ▌
▄▌▌▓▓████▄ ██ ▓█▀ ▄▌▀▄ ▓▓▌▄ ▓█ ▄▌▓▓▌▄ ▌▌ ▓
▓█████████▌▓▓ ██▓█▄ ▓█▄▓▓ ▐█▌ ██ ▓█ █▌ ██ █▌ █▓
▓▓▓▓▀▀▀▀▓▓▓▓▓▓▌ ██ █▓ ▓▌▄▄ ▐█▓▄▓█▀ █▓█ ▀█▄▄█▀ █▓█
▓▌ ▐█▌ █▌
▓
v0.1.0-dev
Warning: delay is set to 5 seconds, incase your app takes more time to start use --delay to set custom delay
Example usage:
keploy test -c "docker run -p 8080:808 --network myNetworkName --rm myApplicationImageName" --delay 6\n
🐰 Keploy: 2023-09-27T15:11:44Z INFO cmd/test.go:122 {"keploy test and mock path": "/files/keploy", "keploy testReport path": "/files/keploy/testReports"}
🐰 Keploy: 2023-09-27T15:11:46Z INFO hooks/loader.go:760 keploy initialized and probes added to the kernel.
🐰 Keploy: 2023-09-27T15:11:46Z INFO proxy/proxy.go:435 Keploy has hijacked the DNS resolution mechanism, your application may misbehave in keploy test mode if you have provided wrong domain name in your application code.
🐰 Keploy: 2023-09-27T15:11:46Z INFO proxy/proxy.go:496 Proxy started at port:16789
🐰 Keploy: 2023-09-27T15:11:46Z INFO proxy/proxy.go:674 starting DNS server at addr :16789
🐰 Keploy: 2023-09-27T15:11:46Z INFO test/test.go:175 running user application for test run of test set {"test-set": "test-set-0"}
[+] Running 2/0
✔ Container mongoDB Created 0.0s
✔ Container ginMongoApp Created 0.0s
Attaching to ginMongoApp, mongoDB
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.337+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'"}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.338+00:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"main","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.340+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."}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.341+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.tenantMigrationDonors"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.341+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"config.tenantMigrationRecipients"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.341+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"ShardSplitDonorService","namespace":"config.tenantSplitDonors"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.341+00:00"},"s":"I", "c":"CONTROL", "id":5945603, "ctx":"main","msg":"Multi threading initialized"}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.341+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":"edd4748a819a"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.341+00:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"6.0.8","gitVersion":"3d84c0dd4e5d99be0d69003652313e7eaf4cdd74","openSSLVersion":"OpenSSL 3.0.2 15 Mar 2022","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2204","distarch":"aarch64","target_arch":"aarch64"}}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.341+00:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"22.04"}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.341+00:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"}}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.342+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"]}
mongoDB | {"t":{"$date":"2023-09-27T15:11:47.342+00:00"},"s":"I", "c":"STORAGE", "id":22315, "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=473M,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],"}}
ginMongoApp | PID: 1
ginMongoApp | [GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
ginMongoApp |
ginMongoApp | [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
ginMongoApp | - using env: export GIN_MODE=release
ginMongoApp | - using code: gin.SetMode(gin.ReleaseMode)
ginMongoApp |
ginMongoApp | [GIN-debug] GET /:param --> main.getURL (3 handlers)
ginMongoApp | [GIN-debug] POST /url --> main.putURL (3 handlers)
ginMongoApp | [GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
ginMongoApp | Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
ginMongoApp | [GIN-debug] Listening and serving HTTP on :8080
🐰 Keploy: 2023-09-27T15:11:47Z INFO hooks/launch.go:310 container & network found and processed successfully {"time": 1695827507862282612}
🐰 Keploy: 2023-09-27T15:11:47Z INFO test/test.go:245 {"no of test cases": 3, "test-set": "test-set-0"}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.049+00:00"},"s":"I", "c":"STORAGE", "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":707}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.050+00:00"},"s":"I", "c":"RECOVERY", "id":23987, "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.062+00:00"},"s":"W", "c":"CONTROL", "id":22120, "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.062+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'","tags":["startupWarnings"]}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.062+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"]}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.062+00:00"},"s":"I", "c":"STORAGE", "id":20320, "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"admin.system.version","uuidDisposition":"provided","uuid":{"uuid":{"$uuid":"d46b7847-bcad-4e51-8f45-1392c90fa235"}},"options":{"uuid":{"$uuid":"d46b7847-bcad-4e51-8f45-1392c90fa235"}}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.067+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"collectionUUID":{"uuid":{"$uuid":"d46b7847-bcad-4e51-8f45-1392c90fa235"}},"namespace":"admin.system.version","index":"_id_","ident":"index-1--4600725948039561392","collectionIdent":"collection-0--4600725948039561392","commitTimestamp":null}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.068+00:00"},"s":"I", "c":"REPL", "id":20459, "ctx":"initandlisten","msg":"Setting featureCompatibilityVersion","attr":{"newVersion":"6.0"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.068+00:00"},"s":"I", "c":"REPL", "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"6.0","context":"setFCV"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.068+00:00"},"s":"I", "c":"NETWORK", "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.068+00:00"},"s":"I", "c":"NETWORK", "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.068+00:00"},"s":"I", "c":"REPL", "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"6.0","context":"startup"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.068+00:00"},"s":"I", "c":"STORAGE", "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.068+00:00"},"s":"I", "c":"CONTROL", "id":20536, "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.069+00:00"},"s":"I", "c":"FTDC", "id":20625, "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.071+00:00"},"s":"I", "c":"STORAGE", "id":20320, "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.startup_log","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"4f044966-120e-45bc-8b21-2405dbbf735b"}},"options":{"capped":true,"size":10485760}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.078+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"collectionUUID":{"uuid":{"$uuid":"4f044966-120e-45bc-8b21-2405dbbf735b"}},"namespace":"local.startup_log","index":"_id_","ident":"index-3--4600725948039561392","collectionIdent":"collection-2--4600725948039561392","commitTimestamp":null}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.079+00:00"},"s":"I", "c":"REPL", "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.079+00:00"},"s":"I", "c":"STORAGE", "id":22262, "ctx":"initandlisten","msg":"Timestamp monitor starting"}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.081+00:00"},"s":"I", "c":"STORAGE", "id":20320, "ctx":"LogicalSessionCacheRefresh","msg":"createCollection","attr":{"namespace":"config.system.sessions","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"94000752-2c93-4489-833f-7fbe316e4861"}},"options":{}}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.081+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.081+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.081+00:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.083+00:00"},"s":"I", "c":"CONTROL", "id":20712, "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.089+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"LogicalSessionCacheRefresh","msg":"Index build: done building","attr":{"buildUUID":null,"collectionUUID":{"uuid":{"$uuid":"94000752-2c93-4489-833f-7fbe316e4861"}},"namespace":"config.system.sessions","index":"_id_","ident":"index-5--4600725948039561392","collectionIdent":"collection-4--4600725948039561392","commitTimestamp":null}}
mongoDB | {"t":{"$date":"2023-09-27T15:11:48.089+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"LogicalSessionCacheRefresh","msg":"Index build: done building","attr":{"buildUUID":null,"collectionUUID":{"uuid":{"$uuid":"94000752-2c93-4489-833f-7fbe316e4861"}},"namespace":"config.system.sessions","index":"lsidTTLIndex","ident":"index-6--4600725948039561392","collectionIdent":"collection-4--4600725948039561392","commitTimestamp":null}}
🐰 Keploy: 2023-09-27T15:11:52Z INFO pkg/util.go:65 making a http request {"test case id": "test-1"}
ginMongoApp | [GIN] 2023/09/27 - 15:11:52 | 200 | 2.257208ms | ::1 | POST "/url"
Testrun passed for testcase with id: "test-1"
--------------------------------------------------------------------
🐰 Keploy: 2023-09-27T15:11:52Z INFO test/test.go:311 result {"testcase id": "test-1", "passed": true}
🐰 Keploy: 2023-09-27T15:11:52Z INFO pkg/util.go:65 making a http request {"test case id": "test-2"}
ginMongoApp | [GIN] 2023/09/27 - 15:11:52 | 303 | 494.166µs | ::1 | GET "/Lhr4BWAi"
Testrun passed for testcase with id: "test-2"
--------------------------------------------------------------------
🐰 Keploy: 2023-09-27T15:11:52Z INFO test/test.go:311 result {"testcase id": "test-2", "passed": true}
🐰 Keploy: 2023-09-27T15:11:52Z INFO pkg/util.go:65 making a http request {"test case id": "test-3"}
ginMongoApp | [GIN] 2023/09/27 - 15:11:52 | 404 | 579.292µs | ::1 | GET "/Lhr4BWA"
ginMongoApp | {"level":"error","ts":1695827512.8748355,"caller":"app/handler.go:60","msg":"failed to find url in the database","error":"mongo: no documents in result","hash":"Lhr4BWA","stacktrace":"main.getURL\n\t/app/handler.go:60\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168\ngithub.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/recovery.go:99\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168\ngithub.com/gin-gonic/gin.LoggerWithConfig.func1\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/logger.go:241\ngithub.com/gin-gonic/gin.(*Context).Next\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:555\ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:511\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2868\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1933"}
Testrun passed for testcase with id: "test-3"
--------------------------------------------------------------------
🐰 Keploy: 2023-09-27T15:11:52Z INFO test/test.go:311 result {"testcase id": "test-3", "passed": true}
🐰 Keploy: 2023-09-27T15:11:52Z INFO test/test.go:118 test run completed {"passed overall": true}
🐰 Keploy: 2023-09-27T15:11:52Z INFO hooks/loader.go:377 Exiting keploy program gracefully.
🐰 Keploy: 2023-09-27T15:11:52Z ERROR test/test.go:182 failed to run user application hence stopping keploy {"error": "exited due to command error"}
🐰 Keploy: 2023-09-27T15:11:54Z INFO hooks/loader.go:426 eBPF resources released successfully...
🐰 Keploy: 2023-09-27T15:11:54Z ERROR mongoparser/mongoparser.go:68 failed to read request from the mongo client {"Client IP Address": "172.20.0.3:43306", "Client ConnectionID": 2, "Destination IP Address": "172.17.0.2:27017", "Destination ConnectionID": 3, "error": "read tcp 172.20.0.4:16789->172.20.0.3:43306: use of closed network connection", "clientConnId": 2}
🐰 Keploy: 2023-09-27T15:11:54Z ERROR mongoparser/mongoparser.go:68 failed to read request from the mongo client {"Client IP Address": "172.20.0.3:43318", "Client ConnectionID": 4, "Destination IP Address": "172.17.0.2:27017", "Destination ConnectionID": 5, "error": "read tcp 172.20.0.4:16789->172.20.0.3:43318: use of closed network connection", "clientConnId": 4}
🐰 Keploy: 2023-09-27T15:11:54Z INFO proxy/proxy.go:1123 Dns server stopped
🐰 Keploy: 2023-09-27T15:11:54Z INFO proxy/proxy.go:1125 proxy stopped...
But on next day, same thing didn't work. Logs are as follows:
2023/09/28 16:51:27 must use ASL logging (which requires CGO) if running as root
latest: Pulling from keploy/keploy
Digest: sha256:d592c1589e6acb3a2a8968c5ad6f53c53f0d23dbcbad8e5ebca8409f0f4c4325
Status: Image is up to date for ghcr.io/keploy/keploy:latest
▓██▓▄
▓▓▓▓██▓█▓▄
████████▓▒
▀▓▓███▄ ▄▄ ▄ ▌
▄▌▌▓▓████▄ ██ ▓█▀ ▄▌▀▄ ▓▓▌▄ ▓█ ▄▌▓▓▌▄ ▌▌ ▓
▓█████████▌▓▓ ██▓█▄ ▓█▄▓▓ ▐█▌ ██ ▓█ █▌ ██ █▌ █▓
▓▓▓▓▀▀▀▀▓▓▓▓▓▓▌ ██ █▓ ▓▌▄▄ ▐█▓▄▓█▀ █▓█ ▀█▄▄█▀ █▓█
▓▌ ▐█▌ █▌
▓
v0.1.0-dev
🐰 Keploy: 2023-09-28T11:21:28Z INFO cmd/record.go:110 {"keploy test and mock path": "/files/keploy"}
🐰 Keploy: 2023-09-28T11:21:30Z INFO hooks/loader.go:760 keploy initialized and probes added to the kernel.
🐰 Keploy: 2023-09-28T11:21:30Z INFO proxy/proxy.go:496 Proxy started at port:16789
[+] Running 2/0
✔ Container mongoDB Created 0.0s
✔ Container ginMongoApp Created 0.0s
Attaching to ginMongoApp, mongoDB
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.463+00:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.464+00:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.464+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."}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.465+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.tenantMigrationDonors"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.465+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"config.tenantMigrationRecipients"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.465+00:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"ShardSplitDonorService","namespace":"config.tenantSplitDonors"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.465+00:00"},"s":"I", "c":"CONTROL", "id":5945603, "ctx":"main","msg":"Multi threading initialized"}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.466+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":"8ea625580dea"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.466+00:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"6.0.8","gitVersion":"3d84c0dd4e5d99be0d69003652313e7eaf4cdd74","openSSLVersion":"OpenSSL 3.0.2 15 Mar 2022","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2204","distarch":"aarch64","target_arch":"aarch64"}}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.466+00:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"22.04"}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.466+00:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"}}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.466+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"]}
mongoDB | {"t":{"$date":"2023-09-28T11:21:31.466+00:00"},"s":"I", "c":"STORAGE", "id":22315, "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=473M,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],"}}
ginMongoApp | PID: 1
ginMongoApp | [GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
ginMongoApp |
ginMongoApp | [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
ginMongoApp | - using env: export GIN_MODE=release
ginMongoApp | - using code: gin.SetMode(gin.ReleaseMode)
ginMongoApp |
ginMongoApp | [GIN-debug] GET /:param --> main.getURL (3 handlers)
ginMongoApp | [GIN-debug] POST /url --> main.putURL (3 handlers)
ginMongoApp | [GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
ginMongoApp | Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
ginMongoApp | [GIN-debug] Listening and serving HTTP on :8080
🐰 Keploy: 2023-09-28T11:21:31Z INFO hooks/launch.go:310 container & network found and processed successfully {"time": 1695900091885775057}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.183+00:00"},"s":"I", "c":"STORAGE", "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":717}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.183+00:00"},"s":"I", "c":"RECOVERY", "id":23987, "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.193+00:00"},"s":"W", "c":"CONTROL", "id":22120, "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.194+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'","tags":["startupWarnings"]}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.194+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"]}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.194+00:00"},"s":"I", "c":"STORAGE", "id":20320, "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"admin.system.version","uuidDisposition":"provided","uuid":{"uuid":{"$uuid":"9ed2aa48-9edd-4391-a9cf-5bfc87f9b1a6"}},"options":{"uuid":{"$uuid":"9ed2aa48-9edd-4391-a9cf-5bfc87f9b1a6"}}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.200+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"collectionUUID":{"uuid":{"$uuid":"9ed2aa48-9edd-4391-a9cf-5bfc87f9b1a6"}},"namespace":"admin.system.version","index":"_id_","ident":"index-1--7581018507831692797","collectionIdent":"collection-0--7581018507831692797","commitTimestamp":null}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.200+00:00"},"s":"I", "c":"REPL", "id":20459, "ctx":"initandlisten","msg":"Setting featureCompatibilityVersion","attr":{"newVersion":"6.0"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.200+00:00"},"s":"I", "c":"REPL", "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"6.0","context":"setFCV"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.200+00:00"},"s":"I", "c":"NETWORK", "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.200+00:00"},"s":"I", "c":"NETWORK", "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.200+00:00"},"s":"I", "c":"REPL", "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"6.0","context":"startup"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.200+00:00"},"s":"I", "c":"STORAGE", "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.201+00:00"},"s":"I", "c":"CONTROL", "id":20536, "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.201+00:00"},"s":"I", "c":"FTDC", "id":20625, "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.203+00:00"},"s":"I", "c":"STORAGE", "id":20320, "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.startup_log","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"71d27eee-b89b-435b-b40d-78bf91301b45"}},"options":{"capped":true,"size":10485760}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.209+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"collectionUUID":{"uuid":{"$uuid":"71d27eee-b89b-435b-b40d-78bf91301b45"}},"namespace":"local.startup_log","index":"_id_","ident":"index-3--7581018507831692797","collectionIdent":"collection-2--7581018507831692797","commitTimestamp":null}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.209+00:00"},"s":"I", "c":"REPL", "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.209+00:00"},"s":"I", "c":"STORAGE", "id":22262, "ctx":"initandlisten","msg":"Timestamp monitor starting"}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.211+00:00"},"s":"I", "c":"STORAGE", "id":20320, "ctx":"LogicalSessionCacheRefresh","msg":"createCollection","attr":{"namespace":"config.system.sessions","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"6b95250d-b927-46cb-877a-5fd2a652214b"}},"options":{}}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.212+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.212+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.212+00:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.213+00:00"},"s":"I", "c":"CONTROL", "id":20712, "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.220+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"LogicalSessionCacheRefresh","msg":"Index build: done building","attr":{"buildUUID":null,"collectionUUID":{"uuid":{"$uuid":"6b95250d-b927-46cb-877a-5fd2a652214b"}},"namespace":"config.system.sessions","index":"_id_","ident":"index-5--7581018507831692797","collectionIdent":"collection-4--7581018507831692797","commitTimestamp":null}}
mongoDB | {"t":{"$date":"2023-09-28T11:21:32.220+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"LogicalSessionCacheRefresh","msg":"Index build: done building","attr":{"buildUUID":null,"collectionUUID":{"uuid":{"$uuid":"6b95250d-b927-46cb-877a-5fd2a652214b"}},"namespace":"config.system.sessions","index":"lsidTTLIndex","ident":"index-6--7581018507831692797","collectionIdent":"collection-4--7581018507831692797","commitTimestamp":null}}
^CGracefully stopping... (press Ctrl+C again to force)
Aborting on container exit...
🐰 Keploy: 2023-09-28T11:21:37Z INFO hooks/loader.go:373 Received signal to exit keploy program..
🐰 Keploy: 2023-09-28T11:21:37Z INFO record/record.go:66 keploy terminated user application
🐰 Keploy: 2023-09-28T11:21:38Z INFO hooks/loader.go:426 eBPF resources released successfully...
🐰 Keploy: 2023-09-28T11:21:38Z INFO proxy/proxy.go:1125 proxy stopped...
The application was running in lima and I was re-running it in Colima, that's why test cases were not captured since earlier running application was addressing the api calls.
Is there an existing issue for this?
Current behavior
I ran samples-go gin-mongo app app on 27th Sep using
keploy record -c "docker compose up" --containerName "ginMongoApp"
it recorded test cases.
Add the following docker compose file -
and replace the docker file as -
and replace line 21 in main.go as -
client, err := New("mongoDb:27017", dbName)
Logs for keploy test command are -
But on next day, same thing didn't work. Logs are as follows:
Steps to reproduce
Given above
Environment
None
Version
Cloud
Repository
keploy