Giuseppe Barbieri
03/05/2024, 12:50 PMI know this might not be related much to LakeFS itself, but I'm out of optionsCopy codeError: Post "<http://127.0.0.1:8081/webhooks/format>": dial tcp 127.0.0.1:8081: connect: connection refused
Giuseppe Barbieri
03/05/2024, 1:00 PMsudo ss -tulpn
and seems fine
tcp LISTEN 0 4096 [:ffff127.0.0.1]:8081 : users:(("java",pid=372597,fd=109))
Isan Rivkin
03/05/2024, 1:11 PMGiuseppe Barbieri
03/05/2024, 1:12 PM_lakefs_actions
name: Dataset
description: This webhook ensures that a DATASET.json should be present
on:
pre-commit:
branches:
- "*"
hooks:
- id: dataset_validator
type: webhook
description: Validate DATASET.json
properties:
url: "<http://127.0.0.1:8082/webhooks/format>"
and then I have a netty server running on localhost with Ktor, which is listening on the given address
> 2024-03-05 140537.410 [main] INFO ktor.application - Autoreload is disabled because the development mode is off.
> 2024-03-05 140537.977 [main] INFO ktor.application - Application started in 0.626 seconds.
> 2024-03-05 140538.190 [DefaultDispatcher-worker-1] INFO ktor.application - Responding at http://127.0.0.1:8082Giuseppe Barbieri
03/05/2024, 1:13 PMGiuseppe Barbieri
03/05/2024, 1:14 PMGiuseppe Barbieri
03/05/2024, 1:16 PMIsan Rivkin
03/05/2024, 1:22 PM8081
but the action file is targeting port 8082
- so maybe make sure ports are correct.
Regarding the host mabe it’s 0.0.0.0
or something else depends how are the network interfaces are defined in your production environment.
Or, maybe there’s no TCP / HTTP connection.
I would test the following:
Be on the same server / container the lakeFS server is running on. (i.e if I run ps aux | grep -i lakefs
so you can see the process of the binary to make sure you share the same network host).
Then run curl <target address>
and see what happens?Giuseppe Barbieri
03/05/2024, 1:23 PMGiuseppe Barbieri
03/05/2024, 1:27 PMGiuseppe Barbieri
03/05/2024, 1:27 PMcurl 127.0.0.1:8082
returns nothingGiuseppe Barbieri
03/05/2024, 1:27 PMbarbie15@lakefs:~$ curl 127.0.0.1
curl: (7) Failed to connect to 127.0.0.1 port 80 after 0 ms: Couldn't connect to server
Oz Katz
Giuseppe Barbieri
03/05/2024, 1:32 PMGiuseppe Barbieri
03/05/2024, 2:24 PMGiuseppe Barbieri
03/05/2024, 2:24 PMGiuseppe Barbieri
03/05/2024, 2:24 PMGiuseppe Barbieri
03/05/2024, 2:39 PMGiuseppe Barbieri
03/05/2024, 2:40 PM2024-03-05 14:26:32.830 [eventLoopGroupProxy-4-1] TRACE io.ktor.routing.Routing - Trace for []
/, segment:0 -> SUCCESS @ /
/webhooks, segment:0 -> FAILURE "Selector didn't match" @ /webhooks
Matched routes:
No results
Route resolve result:
FAILURE "No matched subtrees found" @ /
2024-03-05 14:26:32.855 [eventLoopGroupProxy-4-1] TRACE i.k.s.p.c.ContentNegotiation - Skipping response body transformation from HttpStatusCode to OutgoingContent for the GET / request because the HttpStatusCode type is ignored. See [ContentNegotiationConfig::ignoreType].
2024-03-05 14:26:42.919 [eventLoopGroupProxy-4-2] TRACE io.ktor.routing.Routing - Trace for []
/, segment:0 -> SUCCESS @ /
/webhooks, segment:0 -> FAILURE "Selector didn't match" @ /webhooks
Matched routes:
No results
Route resolve result:
FAILURE "No matched subtrees found" @ /
2024-03-05 14:26:42.920 [eventLoopGroupProxy-4-2] TRACE i.k.s.p.c.ContentNegotiation - Skipping response body transformation from HttpStatusCode to OutgoingContent for the GET / request because the HttpStatusCode type is ignored. See [ContentNegotiationConfig::ignoreType].
2024-03-05 15:39:22.833 [eventLoopGroupProxy-4-3] TRACE io.ktor.routing.Routing - Trace for [webhooks, format]
/, segment:0 -> SUCCESS @ /
/webhooks, segment:1 -> SUCCESS @ /webhooks
/webhooks/format, segment:2 -> SUCCESS @ /webhooks/format
/webhooks/format/(method:POST), segment:2 -> FAILURE "Selector didn't match" @ /webhooks/format/(method:POST)
Matched routes:
No results
Route resolve result:
FAILURE "No matched subtrees found" @ /
2024-03-05 15:39:22.834 [eventLoopGroupProxy-4-3] TRACE i.k.s.p.c.ContentNegotiation - Skipping response body transformation from HttpStatusCode to OutgoingContent for the GET /webhooks/format request because the HttpStatusCode type is ignored. See [ContentNegotiationConfig::ignoreType].
Giuseppe Barbieri
03/05/2024, 2:40 PMbarbie15@lakefs:~$ curl -v <http://127.0.0.1:8082/webhooks/format>
* Trying 127.0.0.1:8082...
* Connected to 127.0.0.1 (127.0.0.1) port 8082 (#0)
> GET /webhooks/format HTTP/1.1
> Host: 127.0.0.1:8082
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 405 Method Not Allowed
< Content-Length: 0
<
* Connection #0 to host 127.0.0.1 left intact
Isan Rivkin
03/05/2024, 2:41 PM-X POST
which is what the lakeFS webhook action is doing.Giuseppe Barbieri
03/05/2024, 2:42 PMbarbie15@lakefs:~$ curl -v -X POST <http://127.0.0.1:8082/webhooks/format>
* Trying 127.0.0.1:8082...
* Connected to 127.0.0.1 (127.0.0.1) port 8082 (#0)
> POST /webhooks/format HTTP/1.1
> Host: 127.0.0.1:8082
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 415 Unsupported Media Type
< Content-Length: 0
<
* Connection #0 to host 127.0.0.1 left intact
Isan Rivkin
03/05/2024, 2:44 PMConnection #0 to host 127.0.0.1 left intact
But, what strange is that in your examples now you are using port 8082
but in the action file you supplied its 8002
, could it be related?Giuseppe Barbieri
03/05/2024, 2:45 PM8002
is it? I see the right 8082
Isan Rivkin
03/05/2024, 2:46 PMis it? I see the rightmy bad 🙂(edited)8082
Giuseppe Barbieri
03/05/2024, 2:46 PMGiuseppe Barbieri
03/05/2024, 2:46 PMGiuseppe Barbieri
03/05/2024, 2:47 PMtelnet
output, though?Isan Rivkin
03/05/2024, 2:47 PMIsan Rivkin
03/05/2024, 2:48 PMIsan Rivkin
03/05/2024, 2:49 PMcurl
are you able to get from the webhook sever logs of that request?
If yes, when running the action in lakeFS do you see it in the server logs?Isan Rivkin
03/05/2024, 2:55 PMGiuseppe Barbieri
03/05/2024, 2:56 PMHow would lakeFS succeed if the curl failed. ?No idea, but now I'm trying to stop the container running on a dedicated user
Giuseppe Barbieri
03/05/2024, 2:56 PMWhen runningyes, those that I pasted aboveare you able to get from the webhook sever logs of that request?curl
Isan Rivkin
03/05/2024, 3:12 PMConnection Refused
has two main causes:
1. Nothing is listening on the IP:Port you are trying to connect to.
2. The port is blocked by a firewall.
From inspecting the ps aux gist you shared i noticed that there are pid’s running lakeFS in a container 825, 783
while also there’s a binary on the host (pid 1183
).
That makes me wonder if you are running more then 1 lakeFS instances and the lakeFS that returns the connection refused error is not the one you think it is.
• i would verify that it’s the same lakeFS that’s responding by directly inspecting the stdout/err logs of the lakeFS process with supported tooling either tail
or other available tools. Then trigger an action and watch the logs.
• If it’s inside a container that really depends on your network setup in production.
• I would also look into ifconfig
settings inspecting the network interfaces defined on the lakeFS host process.
• Finally, try modifying the host address to maybe something else that is available on the host based on the network interfaces. i.e it could be 0.0.0.0
or some internal vpc address like 10.x.y.z
- that really depends on your production environment.Giuseppe Barbieri
03/05/2024, 3:16 PMGiuseppe Barbieri
03/06/2024, 12:49 PMGiuseppe Barbieri
03/06/2024, 12:50 PM#!/usr/bin/bash
podman run --replace --pull=newer\
--name lakeFS \
-p 8000:8000 \
-p 8082:8082 \
Giuseppe Barbieri
03/06/2024, 12:51 PMException in thread "main" java.net.BindException: Address already in useif I stop lakefs, the server starts and listen as usual
Giuseppe Barbieri
03/06/2024, 12:52 PM-p incoming:outgoing
forward the incoming
port on the container on the outgoing
port on the hostIsan Rivkin
03/06/2024, 1:13 PMGiuseppe Barbieri
03/06/2024, 1:13 PMI would recommend starting with lakeFS chart if possible (k8S)what is that?
Isan Rivkin
03/06/2024, 1:14 PM