pact icon indicating copy to clipboard operation
pact copied to clipboard

Unable to run Pact in Ubuntu 18.04 running in Docker on M1

Open mvaljento opened this issue 3 years ago • 2 comments

My apologies if this is not a Pact issue per se, however I'm unable to find ways to debug the problem.

I was running a pact dev server on my earlier Mac (not M1) in Docker on a Ubuntu image without a problem. After upgrading to M1 machine, Pact is responding extremely slowly to commands and is killed if I try to deploy a contract.

For example running

pact -s config.yaml &

pact -a /pact/src/load-hello-world.yaml | curl -H "Content-Type: application/json" -d @- http://localhost:8080/api/v1/send

It takes about ten seconds for the server process to start listening and after running the send command the Pact server process simply says "Killed" and exits with no other errors either with the command or the server. I've tried multiple commands which worked perfectly before the upgrade. I'm running Pact 4.2.1.

Here's the server output (it will keep listening with no other output before the last line):

2022/04/16-08:07:01 [PactService] INIT Initializing pact SQLLite
2022/04/16-08:07:01 [history] Persistence Enabled: log/commands.sqlite
2022/04/16-08:07:01 [api] starting on port 8080
2022/04/16-08:07:01 [PactService] INIT Creating Pact Schema
2022/04/16-08:07:01 [PactPersist] DDL createTable: TableId "SYS_usertables"
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: DataTable (TableId "SYS_usertables")
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: TxTable (TableId "SYS_usertables")
2022/04/16-08:07:01 [PactPersist] DDL createTable: TableId "SYS_keysets"
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: DataTable (TableId "SYS_keysets")
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: TxTable (TableId "SYS_keysets")
2022/04/16-08:07:01 [PactPersist] DDL createTable: TableId "SYS_modules"
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: DataTable (TableId "SYS_modules")
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: TxTable (TableId "SYS_modules")
2022/04/16-08:07:01 [PactPersist] DDL createTable: TableId "SYS_namespaces"
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: DataTable (TableId "SYS_namespaces")
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: TxTable (TableId "SYS_namespaces")
2022/04/16-08:07:01 [PactPersist] DDL createTable: TableId "SYS_pacts"
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: DataTable (TableId "SYS_pacts")
2022/04/16-08:07:01 [Persist-SQLite] DDL createTable: TxTable (TableId "SYS_pacts")
2022/04/16-08:07:01 [disk replay]: No replay found
Killed

mvaljento avatar Apr 16 '22 08:04 mvaljento

Still the same issue after upgrading to Pact v4.3.1. I noticed the moment just running "pact" to get the Pact prompt it takes a long time for the prompt to start and the memory maxes out at 6.7 GB which Docker has allocated for that container. Simple Pact commands within the prompt work fine. I wonder if it has something to do with the file system.

mvaljento avatar Aug 08 '22 14:08 mvaljento

Thanks for filing this @mvaljento - sorry for getting back to you after such a long time period! We'll take a look at this and see if we can't reproduce on our machines

emilypi avatar Feb 02 '23 18:02 emilypi