NguyenIconAI / logspullerservice

0 stars 0 forks source link

Sometimes I get an empty response back #7

Open da-w-xu opened 1 month ago

da-w-xu commented 1 month ago

running docker-compose up:

sometimes i get a good response, sometimes i get an empty response / errors out?

dxu@K27K2J-T7Jh logspullerservice % curl -v --location 'http://localhost:3001/v1/remotelog' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer test1' \
--data '{
    "file": "dpkg.log",
    "n": 1,
    "hosts": [
        {
            "host_name": "http://logpuller2:3000",
            "api_key": "test2"
        },
        {
            "host_name": "http://logpuller3:3000",
            "api_key": "test3"
        }
    ]
}'

* Host localhost:3001 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:3001...
* Connected to localhost (::1) port 3001
> POST /v1/remotelog HTTP/1.1
> Host: localhost:3001
> User-Agent: curl/8.6.0
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer test1
> Content-Length: 265
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Mon, 10 Jun 2024 22:40:52 GMT
< Content-Length: 286
<
{"http://logpuller2:3000":{"status":"200 OK","status_code":200,"logs":["2024-05-30 02:41:13 status installed libc-bin:arm64 2.35-0ubuntu3.8"]},"http://logpuller3:3000":{"status":"200 OK","status_code":200,"logs":["2024-05-30 02:41:13 status installed libc-bin:arm64 2.35-0ubuntu3.8"]}}
* Connection #0 to host localhost left intact
dxu@K27K2J-T7Jh logspullerservice %
dxu@K27K2J-T7Jh logspullerservice %
dxu@K27K2J-T7Jh logspullerservice %
dxu@K27K2J-T7Jh logspullerservice %
dxu@K27K2J-T7Jh logspullerservice % curl -v --location 'http://localhost:3001/v1/remotelog' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer test1' \
--data '{
    "file": "dpkg.log",
    "n": 1,
    "hosts": [
        {
            "host_name": "http://logpuller2:3000",
            "api_key": "test2"
        },
        {
            "host_name": "http://logpuller3:3000",
            "api_key": "test3"
        }
    ]
}'

* Host localhost:3001 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:3001...
* Connected to localhost (::1) port 3001
> POST /v1/remotelog HTTP/1.1
> Host: localhost:3001
> User-Agent: curl/8.6.0
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer test1
> Content-Length: 265
>
* Empty reply from server
* Closing connection
curl: (52) Empty reply from server
NguyenIconAI commented 1 month ago

I'm not able to reproduce this bug. Can you give me more details on how to reproduce it, and send me the logs from all the containers?

Thanks