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

Deployment index API service connection error #102

Open
wangxiaojia-wxj opened this issue Nov 14, 2024 · 3 comments
Open

Deployment index API service connection error #102

wangxiaojia-wxj opened this issue Nov 14, 2024 · 3 comments

Comments

@wangxiaojia-wxj
Copy link

Args:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xa6a67f]

goroutine 6 [running]:
github.com/jackc/pgx/v5/pgtype.(*Map).RegisterType(0xc0001bd420, 0x0)
/go/pkg/mod/github.com/jackc/pgx/v5@v5.6.0/pgtype/pgtype.go:253 +0x1f
github.com/kdimentionaltree/ton-index-go/index.afterConnectRegisterTypes({0x193bdb0, 0xc00007cf00}, 0xc0001df680)
/go/app/index/database.go:26 +0xec
github.com/jackc/pgx/v5/pgxpool.NewWithConfig.func1({0x193bdb0, 0xc00007cf00})
/go/pkg/mod/github.com/jackc/pgx/v5@v5.6.0/pgxpool/pool.go:233 +0x1a8
github.com/jackc/puddle/v2.(*Pool[...]).initResourceValue.func1()
/go/pkg/mod/github.com/jackc/puddle/v2@v2.2.1/pool.go:409 +0xdc
created by github.com/jackc/puddle/v2.(*Pool[...]).initResourceValue in goroutine 1
/go/pkg/mod/github.com/jackc/puddle/v2@v2.2.1/pool.go:407 +0xf6

At what steps and how are database types defined?

data_type_names := []string{
"tonaddr",
"_tonaddr",
"tonhash",
"_tonhash",
}
for _, type_name := range data_type_names {
data_type, _ := conn.LoadType(ctx, type_name)
conn.TypeMap().RegisterType(data_type)
}

@sgrsaga
Copy link

sgrsaga commented Nov 21, 2024

I also get the same error. Is there any solution for this?

/app/entrypoint.sh: line 17: [: mypostgrespassword: integer expression expected
Using postgres connection with password
POSTGRES_HOST=postgres
POSTGRES_DIALECT=postgresql+asyncpg
HOSTNAME=00816b7a399f
TON_INDEXER_API_PORT=8082
POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
TON_INDEXER_TON_HTTP_API_ENDPOINT=localhost:8081
PWD=/
TON_INDEXER_PG_DSN=postgresql://postgres:mypostgrespassword@postgres:5432/ton_index
HOME=/root
POSTGRES_DBNAME=ton_index
POSTGRES_PUBLISH_PORT=5432
POSTGRES_PORT=5432
TON_INDEXER_REDIS_DSN=redis://event-cache:6379
SHLVL=1
POSTGRES_USER=postgres
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
TON_INDEXER_API_ROOT_PATH=/
_=/usr/bin/printenv
Args:  -v2 localhost:8081
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xa6a67f]

goroutine 8 [running]:
github.com/jackc/pgx/v5/pgtype.(*Map).RegisterType(0xc0001fd500, 0x0)
	/go/pkg/mod/github.com/jackc/pgx/v5@v5.6.0/pgtype/pgtype.go:253 +0x1f
github.com/kdimentionaltree/ton-index-go/index.afterConnectRegisterTypes({0x193bdb0, 0xc0000cef00}, 0xc00021db00)
	/go/app/index/database.go:26 +0xec
github.com/jackc/pgx/v5/pgxpool.NewWithConfig.func1({0x193bdb0, 0xc0000cef00})
	/go/pkg/mod/github.com/jackc/pgx/v5@v5.6.0/pgxpool/pool.go:233 +0x1a8
github.com/jackc/puddle/v2.(*Pool[...]).initResourceValue.func1()
	/go/pkg/mod/github.com/jackc/puddle/v2@v2.2.1/pool.go:409 +0xdc
created by github.com/jackc/puddle/v2.(*Pool[...]).initResourceValue in goroutine 1
	/go/pkg/mod/github.com/jackc/puddle/v2@v2.2.1/pool.go:407 +0xf6
Postgres password file: /run/secrets/postgres_password

@wangxiaojia-wxj
Copy link
Author

Start the index worker to automatically pass

@zhy827827
Copy link

seem issuse.Have you solved your problem?

Postgres password file: /run/secrets/postgres_password
/app/entrypoint.sh: line 17: [: MY_PASSWORD: integer expression expected
Using postgres connection with password
POSTGRES_HOST=postgres
POSTGRES_DIALECT=postgresql+asyncpg
HOSTNAME=72eef20c3295
TON_INDEXER_API_PORT=8090
POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
TON_INDEXER_TON_HTTP_API_ENDPOINT=http://127.0.0.1:8998
PWD=/
TON_INDEXER_PG_DSN=postgresql://postgres:MY_PASSWORD@postgres:5432/ton_index1
HOME=/root
POSTGRES_DBNAME=ton_index1
POSTGRES_PUBLISH_PORT=5432
POSTGRES_PORT=5432
TON_INDEXER_REDIS_DSN=redis://event-cache:6379
SHLVL=1
POSTGRES_USER=postgres
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
TON_INDEXER_API_ROOT_PATH=
_=/usr/bin/printenv
Args:  -v2 http://127.0.0.1:8998
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xa6a81f]

goroutine 21 [running]:
github.com/jackc/pgx/v5/pgtype.(*Map).RegisterType(0xc000251650, 0x0)
	/go/pkg/mod/github.com/jackc/pgx/v5@v5.6.0/pgtype/pgtype.go:253 +0x1f
github.com/kdimentionaltree/ton-index-go/index.afterConnectRegisterTypes({0x193bf10, 0xc0001b2ee0}, 0xc00026db00)
	/go/app/index/database.go:26 +0xec
github.com/jackc/pgx/v5/pgxpool.NewWithConfig.func1({0x193bf10, 0xc0001b2ee0})
	/go/pkg/mod/github.com/jackc/pgx/v5@v5.6.0/pgxpool/pool.go:233 +0x1a8
github.com/jackc/puddle/v2.(*Pool[...]).initResourceValue.func1()
	/go/pkg/mod/github.com/jackc/puddle/v2@v2.2.1/pool.go:409 +0xdc
created by github.com/jackc/puddle/v2.(*Pool[...]).initResourceValue in goroutine 1
	/go/pkg/mod/github.com/jackc/puddle/v2@v2.2.1/pool.go:407 +0xf6

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

3 participants