pact-foundation / pact-reference

Reference implementations for the pact specifications
https://pact.io
MIT License
91 stars 46 forks source link

Can't receive list of active servers #274

Open judimator opened 1 year ago

judimator commented 1 year ago

Hi everyone! I am trying to receive list of servers but see freezed process.

Env:

Docker compose file

version: '3'

services:
    server:
        image: pactfoundation/pact-ref-mock-server
        platform: linux/x86_64
        command: start --base-port 9000 --loglevel debug

Add curl via

apk add curl

Step to reproduce:

  1. Create server based on PACT
curl -X POST http://localhost:8080 -H 'Content-Type: application/json' -d '{"provider":{"name":"Alice Service"},"consumer":{"name":"Consumer"},"interactions":[{"description":"a retrieve Mallory request","request":{"method":"GET","path":"/mallory","query":"name=ron&status=good"},"response":{"status":200,"headers":{"Content-Type":"text/html"},"body":"\"That is some good Mallory.\""}}]}'
  1. Get list of servers
    curl http://localhost:8080

Expected result: See list of servers

Actual result: See freezed process and next request to create server is also freezed

Logs:

15:06:33 [INFO] Master server started on port 8080 15:06:33 [INFO] Server key: '5pzKvSH0GU5Yj0ge' 15:06:52 [DEBUG] (5) hyper::proto::h1::io: parsed 5 headers 15:06:52 [DEBUG] (5) hyper::proto::h1::conn: incoming body is content-length (311 bytes) 15:06:52 [DEBUG] (5) hyper::proto::h1::conn: incoming body completed 15:06:52 [DEBUG] (5) pact_mock_server_cli::server: main_resource -> resource_exists 15:06:52 [DEBUG] (5) pact_mock_server_cli::server: main_resource -> process_post 15:06:52 [DEBUG] (6) pact_mock_server_cli::server: starting mock server on thread 15:06:52 [DEBUG] (6) pact_mock_server_cli::server: start_provider => / 15:06:52 [WARN] No metadata found in pact file "/", assuming V3 specification 15:06:52 [WARN] No metadata found in pact file "/", assuming V3 specification 15:06:52 [DEBUG] (6) pact_mock_server_cli::server: Loaded pact = RequestResponsePact { consumer: Consumer { name: "Consumer" }, provider: Provider { name: "Alice Service" }, interactions: [RequestResponseInteraction { id: None, description: "a retrieve Mallory request", provider_states: [], request: Request { method: "GET", path: "/mallory", query: Some({"status": ["good"], "name": ["ron"]}), headers: None, body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["text/html"]}), body: Present(b"\"That is some good Mallory.\"", Some(ContentType { main_type: "text", sub_type: "html", attributes: {}, suffix: None }), None), matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } } }], metadata: {}, specification_version: V3 } 15:06:52 [DEBUG] (6) pact_mock_server_cli::server: Mock server config = MockServerConfig { cors_preflight: false, pact_specification: Unknown, transport_config: {} } 15:06:52 [DEBUG] (6) pact_mock_server_cli::server: Starting mock server with id fe4ece10-4b7d-44a8-b8ca-001051f603dd 15:06:52 [DEBUG] (6) pact_mock_server::mock_server: Started mock server on 0.0.0.0:9000 15:06:52 [DEBUG] (6) pact_mock_server_cli::server: mock server started on port 9000 15:06:52 [DEBUG] (6) pact_mock_server_cli::server: Result of starting mock server: Ok(true) 15:06:52 [DEBUG] (5) pact_mock_server_cli::server: Result of thread: Ok(true) 15:06:52 [DEBUG] (5) webmachine_rust: Final response: WebmachineResponse { status: 200, headers: {"Content-Type": [HeaderValue { value: "application/json", params: {"charset": "ISO-8859-1"}, quote: false }], "Location": [HeaderValue { value: "/mockserver/fe4ece10-4b7d-44a8-b8ca-001051f603dd", params: {}, quote: false }]}, body: Some([123, 34, 109, 111, 99, 107, 83, 101, 114, 118, 101, 114, 34, 58, 123, 34, 105, 100, 34, 58, 34, 102, 101, 52, 101, 99, 101, 49, 48, 45, 52, 98, 55, 100, 45, 52, 52, 97, 56, 45, 98, 56, 99, 97, 45, 48, 48, 49, 48, 53, 49, 102, 54, 48, 51, 100, 100, 34, 44, 34, 112, 111, 114, 116, 34, 58, 57, 48, 48, 48, 125, 125]) } 15:06:52 [DEBUG] (5) hyper::proto::h1::io: flushed 260 bytes 15:06:52 [DEBUG] (4) hyper::proto::h1::conn: read eof

rholshausen commented 1 year ago

Version 1.0.2 released with a fix for this