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

OpenSQL() returns error when not using nutsdb #645

Closed
jihoon-seo opened this issue Jul 14, 2021 · 0 comments · Fixed by #646
Closed

OpenSQL() returns error when not using nutsdb #645

jihoon-seo opened this issue Jul 14, 2021 · 0 comments · Fixed by #646
Assignees
Labels
bug Something isn't working

Comments

@jihoon-seo
Copy link
Member

What happened
:
When using etcd instead of nutsdb,
the Go code line err := common.OpenSQL("../meta_db/dat/cbtumblebug.s3db") causes error.

❯ make run
./cb-tumblebug
[CLOUD-BARISTA].[ERROR]: 2021-07-14 19:46:52 etcd-driver.go:214, github.com/cloud-barista/cb-store/store-drivers/etcd-driver.InitializeDriver() - context deadline exceeded

[Update system environment]

[Setup SQL Database]
Database access info set successfully
unable to open database file: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x51fcbf]

goroutine 1 [running]:
database/sql.(*Stmt).ExecContext(0x0, 0x166ad68, 0xc000130010, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/snap/go/7954/src/database/sql/sql.go:2485 +0x5f
database/sql.(*Stmt).Exec(...)
/snap/go/7954/src/database/sql/sql.go:2514
github.com/cloud-barista/cb-tumblebug/src/core/common.CreateSpecTable(0x164ba60, 0xc000134008)
/home/jhseo/go/src/github.com/cloud-barista/cb-tumblebug/src/core/common/common.go:133 +0xa5
main.main()
/home/jhseo/go/src/github.com/cloud-barista/cb-tumblebug/src/main.go:78 +0x612
Makefile:12: recipe for target 'run' failed
make: *** [run] Error 2

What you expected to happen
:

How to reproduce it (as minimally and precisely as possible)
:

Anything else we need to know?
:

Environment

  • Source version or branch:
  • OS:
  • Others:

Proposed solution
:

Add these lines before the err := common.OpenSQL("../meta_db/dat/cbtumblebug.s3db") line:

	err := os.MkdirAll("../meta_db/dat/", os.ModePerm)
	if err != nil {
		fmt.Println(err.Error())
	}

Any other context
:

@jihoon-seo jihoon-seo added the bug Something isn't working label Jul 14, 2021
@jihoon-seo jihoon-seo self-assigned this Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant