-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostgreSQL Name or service not known bug #820
Comments
Hey @jskorlol , Were you able to make any figure this out? I'm having the same issue. |
New Domain github.INT
niedz., 25 lut 2024, 04:06: jskorlol ***@***.***> napisał(a):
… *Describe the bug*
When executing with PostgreSQL, a DNS error occurs.
*To Reproduce*
Steps to reproduce the behavior:
remotely:
image: immybot/remotely:latest
restart: unless-stopped
labels:
- "traefik.enable=false"
volumes:
- ../data:/app/AppData
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_HTTP_PORTS=5000
- Remotely_ApplicationOptions__DbProvider=PostgreSQL
- Remotely_ConnectionStrings__PostgreSQL=Server=Host=remotely.postgres;Port=5501;Database=remotely;Username=postgres;Password=test123!!@@~~;
networks:
backend:
remotely.postgres:
image: postgres:16.2
restart: unless-stopped
networks:
backend:
aliases:
- remotely.postgres
environment:
- POSTGRES_DB=remotely
- POSTGRES_PASSWORD=test123!!@@~~
ports:
- "5501:5432"
*Remotely Version*
v2024.02.22.1231
*Expected Behavior*
I have several Host values such as server.local and remotely.postgres.
However, it seems that these Hosts are not being resolved correctly.
Unhandled exception. System.Net.Sockets.SocketException (00000005, 0xFFFDFFFF): Name or service not known
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, Nullable`1 startingTimestamp)
at System.Net.Dns.<>c.<GetHostEntryOrAddressesCoreAsync>b__33_0(Object s, Int64 startingTimestamp)
at System.Net.Dns.<>c__DisplayClass39_0`1.<RunAsync>b__0(Task <p0>, Object <p1>)
at System.Threading.Tasks.ContinuationResultTaskFromTask`1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)--- End of stack trace from previous location ---
at Npgsql.TaskTimeoutAndCancellation.ExecuteAsync(Func`2 getTaskFunc, NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.TaskTimeoutAndCancellation.ExecuteAsync[TResult](Func`2 getTaskFunc, NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.Internal.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|213_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.UnpooledDataSource.Get(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.ExistsAsync(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrationsAsync(CancellationToken cancellationToken)
at Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlMigrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
at Program.<Main>$(String[] args) in D:\a\1\s\Server\Program.cs:line 87
at Program.<Main>(String[] args)Unhandled exception. System.Net.Sockets.SocketException (00000005, 0xFFFDFFFF): Name or service not known
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, Nullable`1 startingTimestamp)
at System.Net.Dns.<>c.<GetHostEntryOrAddressesCoreAsync>b__33_0(Object s, Int64 startingTimestamp)
at System.Net.Dns.<>c__DisplayClass39_0`1.<RunAsync>b__0(Task <p0>, Object <p1>)
at System.Threading.Tasks.ContinuationResultTaskFromTask`1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)--- End of stack trace from previous location ---
at Npgsql.TaskTimeoutAndCancellation.ExecuteAsync(Func`2 getTaskFunc, NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.TaskTimeoutAndCancellation.ExecuteAsync[TResult](Func`2 getTaskFunc, NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.Internal.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|213_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.UnpooledDataSource.Get(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.ExistsAsync(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrationsAsync(CancellationToken cancellationToken)
at Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlMigrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
at Program.<Main>$(String[] args) in D:\a\1\s\Server\Program.cs:line 87
at Program.<Main>(String[] args)
- [ v ] I am running Remotely in Docker and not on my QNAP, Synology,
or Internet Connected Toaster
—
Reply to this email directly, view it on GitHub
<#820>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDJKZVG5HMOCAR7CHGJ2573YVKTCTAVCNFSM6AAAAABDYQAJWCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE2TENJXGU2TMOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Can confirm with the following compose file: version: '3.4'
networks:
remotely:
name: remotely-network
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16
gateway: 172.28.0.1
services:
pgdb:
image: postgres:16
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: {REDACTED}
POSTGRES_DB: postgres
PGDATA: /var/lib/postgresql/data
TZ: Europe/London
volumes:
- /mnt/user/appdata/remotely/postgres:/var/lib/postgresql/data
networks:
remotely:
ipv4_address: "172.28.0.2"
app:
image: immybot/remotely:latest
volumes:
- /mnt/user/appdata/remotely/server:/app/AppData
- /mnt/user/appdata/remotely/aspnet:/root/.aspnet/
restart: unless-stopped
depends_on:
- pgdb
ports:
- "5000:5000"
networks:
remotely:
ipv4_address: "172.28.0.5"
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_HTTP_PORTS=5000
# Other ASP.NET Core configurations can be overridden here, such as Logging.
# See https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-8.0
# Values for DbProvider are SQLite, SQLServer, and PostgreSQL.
- Remotely_ApplicationOptions__DbProvider=PostgreSQL
# The Docker gateway will be used in Forwarded Headers, which is necessary to
# to correctly determine request hostname and scheme within the app. If you change
# the network config, you must update this value as well.
- Remotely_ApplicationOptions__DockerGateway=172.28.0.1
# This path shouldn't be changed. It points to the Docker volume.
- Remotely_ConnectionStrings__SQLite=Data Source=/app/AppData/Remotely.db
# If using SQL Server, change the connection string to point to your SQL Server instance.
- Remotely_ConnectionStrings__SQLServer=Server=(localdb)\\mssqllocaldb;Database=Remotely-Server-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true
# If using PostgreSQL, change the connection string to point to your PostgreSQL instance.
- Remotely_ConnectionStrings__PostgreSQL=Server=Host=pgdb;Database=Remotely;Username=postgres
|
Have the same problem |
Found the problem! Delete the "Server=" part of the connection string. Remotely_ConnectionStrings__PostgreSQL=Server=Host=remotely_db;Port=5432;Database=remotely;Username=remotely;Password=changeme123; must be Remotely_ConnectionStrings__PostgreSQL=Host=remotely_db;Port=5432;Database=remotely;Username=remotely;Password=changeme123; |
...and if you want to do it securely, tack on |
Solution for " PostgreSQL Name or service not known bug #820"
Describe the bug
When executing with PostgreSQL, a DNS error occurs.
To Reproduce
Steps to reproduce the behavior:
Remotely Version
v2024.02.22.1231
Expected Behavior
I have several Host values such as server.local and remotely.postgres. However, it seems that these Hosts are not being resolved correctly.
The text was updated successfully, but these errors were encountered: