I just switched the region for my database and my app and now my app can't connect to the DB

I just switched regions for my app and database and I guess it makes entirely new machines when you do this and it may have also updated the progres version my database was running on.

Now my app can’t connect to the database and I can’t figure out a fix for this. Can anyone help?

I don’t think any of these logs will help but just in case

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] Npgsql.NpgsqlException (0x80004005): Exception while reading from stream

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.Internal.NpgsqlReadBuffer.<Ensure>g__EnsureLong|55_0(NpgsqlReadBuffer buffer, Int32 count, Boolean async, Boolean readingNotifications)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.Internal.NpgsqlReadBuffer.<Ensure>g__EnsureLong|55_0(NpgsqlReadBuffer buffer, Int32 count, Boolean async, Boolean readingNotifications)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|213_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.UnpooledDataSource.Get(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.ExistsAsync(CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrationsAsync(CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlMigrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)

2024-10-17T07:29:10.594 app[32871421a3d138] lax [info] at Program.<Main>$(String[] args) in /app/Program.cs:line 138

I ran the below command and see that the app config is on the old region.

Could that be a problem?

fly config show -a
{
“app”: “”,
“primary_region”: “sjc”,

“env”: {
“PRIMARY_REGION”: “sjc”
},

It also doesn’t have a name, I don’t recall if it did before

Groups
NAME COUNT KIND CPUS MEMORY REGIONS
1 shared 4 2048 MB lax

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.