Skip to content
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

Failed to initialize database when running indexer for testnet #31

Closed
hai-nguyen-van opened this issue Dec 29, 2020 · 2 comments
Closed

Comments

@hai-nguyen-van
Copy link
Contributor

I am trying to run the indexer for delphinet as explained at this step. However, I am stuck at this error. I don't understand the error message:

$ dotnet Tzkt.Sync.dll
info: Tzkt.Sync.Program[0]
      Initialize database
crit: Tzkt.Sync.Program[0]
      Failed to initialize database: Resource temporarily unavailable
Unhandled exception. System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000001, 11): Resource temporarily unavailable
   at System.Net.Dns.InternalGetHostByName(String hostName)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
   at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<<Open>g__OpenLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnection.Open()
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists()
   at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
   at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrations()
   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetAppliedMigrations(DatabaseFacade databaseFacade)
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 60
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.IHostExt.Init(IHost host, Int32 attempt) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 83
   at Tzkt.Sync.Program.Main(String[] args) in /home/nguyen-van/tzkt/Tzkt.Sync/Program.cs:line 20
Aborted (core dumped)

Does this mean that it cannot have access to the database? Or to rpc.tzkt.io/delphinet? Yet, the database is available:

$ nmap -PN localhost
Starting Nmap 7.80 ( https://nmap.org ) at 2020-12-29 12:05 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000068s latency).
Not shown: 998 closed ports
PORT     STATE SERVICE
631/tcp  open  ipp
5432/tcp open  postgresql
@Groxan
Copy link
Member

Groxan commented Dec 29, 2020

This means that the indexer cannot connect to the database using the connection string you provided. Did you customize the connection string somehow? Also, look at the similar issue npgsql/efcore.pg#619 (comment), and let me know if that helps. You can find allowed connection string parameters here: https://www.npgsql.org/doc/connection-string-parameters.html

Also, try to connect to the database manually via psql with the same user as in the connection string, to make sure the database is available.

@hai-nguyen-van
Copy link
Contributor Author

My bad! I found the tiny spot of the problem.

ajinkyaraj-23 pushed a commit to ajinkyaraj-23/tzkt that referenced this issue Oct 7, 2024
…baking-bad#31)

* [dal] use a dictionnary for the DalAttestationsCache

* [dal] update dal commitment status during attestation handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants