NeonN
Neon3y ago
2 replies
sacred-rose

File "require" not found when trying to connect to neondb database

Hello !

I tried neondb 2 months ago and i loved it. it worked fine until sundenly this errors appears, since i found no way to remove it.

(Please check the message.txt file attach to it)

The problems appears on the method EnsureInitializedAsync here the implementation of this methods which is generic :

    public async Task EnsureInitializedAsync(Func<bool>? dropDbCondition = null, CancellationToken cancellationToken = default)
    {
        bool allMigrationsApplied = await AreAllMigrationsAppliedAsync(cancellationToken);
        if (allMigrationsApplied)
        {
            _logger.LogInformation("All migrations are already applied");
            return;
        }

        _logger.LogInformation("Some migrations must be applied");
        if (dropDbCondition?.Invoke() == true)
        {
            _logger.LogInformation("Deleting database...");
            await _context.Database.EnsureDeletedAsync(cancellationToken);
            _logger.LogInformation("Database deleted");
        }

        _logger.LogInformation("Applying migrations...");
        await _context.Database.MigrateAsync(cancellationToken: cancellationToken);
        _logger.LogInformation("Migrations applied");
    }


It basically uses Entity Framework's migrations and apply migration if some are not on the database. It seems like NpgSQL seems to get the certificate it tries to read a file named "require" for some reason ?

What i basically tried :
- Using another postgresql 15 database with sslmode=require, that works so that's not it
- Update/Reinstall Npgsql EFCore, still not working
- Restarting app and even recreated it.
- Running the project on another server, it does work but i really need this on the main server.

Still nothing worked. do you guys have any idea ?

thanks.
Was this page helpful?