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

[DOC]: err="init database problem solution #144

Open
thydself opened this issue Jun 12, 2024 · 2 comments
Open

[DOC]: err="init database problem solution #144

thydself opened this issue Jun 12, 2024 · 2 comments

Comments

@thydself
Copy link

thydself commented Jun 12, 2024

After starting the oimws service, the connection to port 10003 still failed. Checking the mage log, the full text is as follows:
EROR [2024-06-12 09:24:19.210] [responder.go:31] msg="sendOnErrorResp" operationID="gmm9kk5be31718155459046" event="Login" err="init database ==> github.com/openimsdk/openim-sdk-core/v3/pkg/db.NewDataBase()@88: initDB failed _output/db: ==> github.com/openimsdk/openim-sdk-core/v3/pkg/db.(*DataBase).initDB()@116: open db failed /root/oimws/_output/bin/platforms/linux/arm64/_output/db/OpenIM_v3_252817.db: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub: 10006 SdkInternalError"

This issue is due to the 'CGO_ENABLED=0' setting in go env.

Solution:
Enter the following commands in the terminal:
export CGO_ENABLED=1
apt-get update
apt-get install gcc

Check with:
go env | grep CGO_ENABLED
mage
mage start

I hope this issue can help everyone.

@kubbot kubbot changed the title [DOC]: err="init database 问题解决方案 [DOC]: err="init database problem solution Jun 12, 2024
@kubbot
Copy link

kubbot commented Jun 12, 2024

Hello! Thank you for filing an issue.

If this is a bug report, please include relevant logs to help us debug the problem.

Join slack 🤖 to connect and communicate with our developers.

@Coderyangg
Copy link

Hi,I have the same problem,and I have checked my CGO_ENABLED=1,but it still throw this error

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