owncloud / owncloud/ocis

gateway tries to contact itself on 127.0.0.1, can't be changed?

Open
#10,404 1 comment 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## Describe the bug

When I set `GATEWAY_GRPC_ADDR` to a bind address that makes the gateway NOT bind to the localhost interface `127.0.0.1`, the gateway can't contact itself.

I didn't find a configuration option where we can configure where the gateway can contact itself.

Originally found in https://github.com/owncloud/ocis/issues/10381#issuecomment-2429155766 :

> I tried to workaround this by replacing the wildcard bind 0.0.0.0 by an actual interface ip, eg:
>
> ```
> - name: POD_IP
> valueFrom:
> fieldRef:
> fieldPath: status.podIP
>
> - name: GATEWAY_GRPC_ADDR
> value: $(POD_IP):9142
> - name: GATEWAY_DEBUG_ADDR
> value: $(POD_IP):9143
> ```
>
> But this fails on the gateway, because it tries to talk to itself via 127.0.0.1. During a quick search, I didn't find a config option to tell the gateway where it could contact itself...

## Expected behavior
The gateway has no requirement to bind to 127.0.0.1.

## Actual behavior

The gateway errors when it doesn't bind to 127.0.0.1.

```
gateway-7fc4cc8b49-st56p gateway {"level":"error","service":"gateway","pkg":"rgrpc","traceid":"899f0668f2a6e2756bbbd090ba86372d","error":"gateway: error calling GetAuthProvider: rpc error: code = Unavailable desc = last connection error: connection error: desc = \"transport: Error while dialing: dial tcp 127.0.0.1:9142: connect: connection refused\"","type":"machine","time":"2024-10-24T05:41:28Z","line":"github.com/cs3org/reva/v2@v2.25.0/internal/grpc/services/gateway/authprovider.go:48","message":"error getting auth provider client"}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.