Communication with internal service failed without `http`

HI, I am trying internal service using Grpc communication but the private network communication can be through http only(based on the documentation https://docs.railway.app/guides/private-networking#use-internal-hostname-and-port) not on TCP communication. Is there any way to workaround private communication
Railway Docs
Private Networking | Railway Docs
Documentation for Railway
Solution:
https://docs.railway.app/guides/private-networking#private-network-context
The private network exists in the context of a project and environment...
Jump to solution
35 Replies
Brody
Brody11mo ago
the private network works with http, tcp, and udp that documentation does only talk about using it with http though
jawahar273
jawahar273OP11mo ago
cool,
jawahar273
jawahar273OP11mo ago
when I try to make grpc call(image 1) it say host not found but I have set the host (image 2)
service a
No description
jawahar273
jawahar273OP11mo ago
both image are from two different service
Brody
Brody11mo ago
are you deploying with a dockerfile?
jawahar273
jawahar273OP11mo ago
yes ok, container lookup fails
Brody
Brody11mo ago
okay side bar, aren't you trying to make a grpc call to the service that is making the call?
jawahar273
jawahar273OP11mo ago
ok, I understand you confusion I have mess up public domain naming little bit not with internal service here I have update the public domain
jawahar273
jawahar273OP11mo ago
No description
Brody
Brody11mo ago
yeah that makes much more sense now okay send your dockerfile please
jawahar273
jawahar273OP11mo ago
head up, it might be little confusing, I am using two build(it is hobby project) one is based go and rust
FROM rust:1.72.0 as rust-build

RUN apt update && apt install -y protobuf-compiler

WORKDIR /app

COPY ./ /app

# RUN protoc --prost-serde_out=/app/server/proto/ -I proto /app/server/proto/api/v1/glue.proto
RUN cd /app/server && cargo build --release
RUN mv /app/server/target/release/server /app/server/target/release/app

FROM golang:1.21.5 as go-build

WORKDIR /go/src/app

RUN apt update && apt install -y protobuf-compiler

COPY ./server ./

RUN go mod download
RUN go vet -v
RUN go test -v

RUN CGO_ENABLED=0 go build -o /go/bin/app


# FROM gcr.io/distroless/static-debian12
FROM debian
WORKDIR /demo

COPY --from=rust-build /app/server/target/release/app /demo/r/
COPY --from=go-build /go/bin/app /demo/g/
FROM rust:1.72.0 as rust-build

RUN apt update && apt install -y protobuf-compiler

WORKDIR /app

COPY ./ /app

# RUN protoc --prost-serde_out=/app/server/proto/ -I proto /app/server/proto/api/v1/glue.proto
RUN cd /app/server && cargo build --release
RUN mv /app/server/target/release/server /app/server/target/release/app

FROM golang:1.21.5 as go-build

WORKDIR /go/src/app

RUN apt update && apt install -y protobuf-compiler

COPY ./server ./

RUN go mod download
RUN go vet -v
RUN go test -v

RUN CGO_ENABLED=0 go build -o /go/bin/app


# FROM gcr.io/distroless/static-debian12
FROM debian
WORKDIR /demo

COPY --from=rust-build /app/server/target/release/app /demo/r/
COPY --from=go-build /go/bin/app /demo/g/
Brody
Brody11mo ago
enclose it in triple backticks so it's formatted as a code block please
jawahar273
jawahar273OP11mo ago
I was going to ask about something like that updated
Brody
Brody11mo ago
are the groku and timex services in the same project?
jawahar273
jawahar273OP11mo ago
it just naming but yes groku is the api layer(golang) which communicate as REST api and timex is private service
Brody
Brody11mo ago
but both services exist within the same railway project?
jawahar273
jawahar273OP11mo ago
yes my initial idea was to use K8s, but i have drop as I realize it just for demo purpose so no need for k8s basically need to figuour how to communicate with external tcp connect inside docker container
Brody
Brody11mo ago
can i see a screenshot of your project please
jawahar273
jawahar273OP11mo ago
you are asking for source code or just railway project screenshot
Brody
Brody11mo ago
second option
jawahar273
jawahar273OP11mo ago
No description
Brody
Brody11mo ago
where is the timex service?
jawahar273
jawahar273OP11mo ago
No description
Brody
Brody11mo ago
those arent the same projects im curious as to why you said yes to this question?
jawahar273
jawahar273OP11mo ago
both are deployed in railway right? may be context got bit messed up it but fine
Solution
Brody
Brody11mo ago
https://docs.railway.app/guides/private-networking#private-network-context
The private network exists in the context of a project and environment
Brody
Brody11mo ago
so yeah, those two services need to be in the same project
jawahar273
jawahar273OP11mo ago
oh!, now I believe where the problem is in a project where can multiple service but currently I have create two different project where I am trying to make integration.
Brody
Brody11mo ago
exactly
jawahar273
jawahar273OP11mo ago
beginner dumbass
Brody
Brody11mo ago
no worries, you where close, just had to read the rest of the docs page
jawahar273
jawahar273OP11mo ago
let me check again
Brody
Brody11mo ago
i mean ive already shown you what you needed to read do you know what you need to do to fix it?
jawahar273
jawahar273OP11mo ago
I have to create two service inside same project
Brody
Brody11mo ago
bingo
Want results from more Discord servers?
Add your server