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

Doesn't start clickhouse-backup server #790

Closed
kiper-prog opened this issue Nov 23, 2023 · 5 comments
Closed

Doesn't start clickhouse-backup server #790

kiper-prog opened this issue Nov 23, 2023 · 5 comments
Milestone

Comments

@kiper-prog
Copy link

Hello, deployed according to the documentation along with clickhouse-operator in kubernetes:
https://github.com/Altinity/clickhouse-backup/blob/master/Examples.md#how-to-use-clickhouse-backup-in-kubernetes
Image: altinity/clickhouse-backup:2.4.5 and altinity/clickhouse-backup:master

What am I doing wrong?

+ /bin/clickhouse-backup server
2023/11/23 10:23:23.559751  info clickhouse connection prepared: tcp://localhost:9000 run ping logger=clickhouse
2023/11/23 10:23:23.561737  info clickhouse connection open: tcp://localhost:9000 logger=clickhouse
2023/11/23 10:23:23.561787  info Create integration tables logger=server
2023/11/23 10:23:23.561802  info clickhouse connection prepared: tcp://localhost:9000 run ping logger=clickhouse
2023/11/23 10:23:23.563464  info clickhouse connection open: tcp://localhost:9000 logger=clickhouse
2023/11/23 10:23:23.563523  info clickhouse connection closed logger=clickhouse
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/Altinity/clickhouse-backup/pkg/server.(*APIServer).CreateIntegrationTables(0xc0001e20e0)
	/home/runner/work/clickhouse-backup/clickhouse-backup/pkg/server/server.go:1497 +0xb6a
github.com/Altinity/clickhouse-backup/pkg/server.Run(0xc000133340, 0xc000014e00, {0x17de1ab, 0x21}, {0x1a5a160, 0x28})
	/home/runner/work/clickhouse-backup/clickhouse-backup/pkg/server/server.go:96 +0x366
main.main.func17(0xc000133340?)
	/home/runner/work/clickhouse-backup/clickhouse-backup/cmd/clickhouse-backup/main.go:573 +0x48
github.com/urfave/cli.HandleAction({0x14e45e0?, 0xc00047d5c0?}, 0x6?)
	/home/runner/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524 +0x50
github.com/urfave/cli.Command.Run({{0x17af99e, 0x6}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x17bd4b3, 0xe}, {0x0, ...}, ...}, ...)
	/home/runner/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175 +0x63e
github.com/urfave/cli.(*App).Run(0xc000014e00, {0xc00003e060, 0x2, 0x2})
	/home/runner/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277 +0xb27
main.main()
	/home/runner/work/clickhouse-backup/clickhouse-backup/cmd/clickhouse-backup/main.go:599 +0x3fbe
@Slach
Copy link
Collaborator

Slach commented Nov 23, 2023

something wrong with your backup configuration
is your API_LISTEN contains port ?
it shall be in host:port format

- name: API_LISTEN
  value: "0.0.0.0:7171"

@Slach Slach added this to the 2.4.6 milestone Nov 23, 2023
@Slach Slach closed this as completed in b363d94 Nov 23, 2023
@kiper-prog
Copy link
Author

Yes, it contains, the following envs are also defined:

                - name: LOG_LEVEL
                  value: "debug"
                - name: ALLOW_EMPTY_BACKUPS
                  value: "true"
                - name: API_LISTEN
                  value: "0.0.0.0:7171"
                - name: API_CREATE_INTEGRATION_TABLES
                  value: "true"
                - name: BACKUPS_TO_KEEP_REMOTE
                  value: "3"
                - name: REMOTE_STORAGE
                  value: "s3"
                - name: S3_REGION
                  value: "region"
                - name: S3_ACL
                  value: "private"
                - name: S3_ENDPOINT
                  value: "path"
                - name: S3_BUCKET
                  value: path
                - name: S3_PATH
                  value: "clickhouse/shard-{shard}/"
                - name: S3_ACCESS_KEY
                  value: backup-access-key
                - name: S3_SECRET_KEY
                  value: backup-secret-key

@kiper-prog
Copy link
Author

Sorry, I found my mistake. Yes, my variable was defined incorrectly. Thanks.

Slach added a commit that referenced this issue Nov 23, 2023
@Slach
Copy link
Collaborator

Slach commented Nov 23, 2023

clickhouse-backup/pkg/server/server.go:1497

from your shared stacktrace

it was

port := strings.Split(api.config.API.ListenAddr, ":")[1]

only one reason for out of range error possible here, when ListenAddr doesn't contain ":"

Are you sure your API_LISTEN environment passed exactly to clickhouse-backup container?

@Slach
Copy link
Collaborator

Slach commented Nov 23, 2023

Could you check altinity/clickhouse-backup:2.4.6?

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