openimsdk / oimws

A websocket and tcp framework for openim
MIT License
17 stars 13 forks source link

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

Open thydself opened 3 weeks ago

thydself commented 3 weeks ago

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 commented 3 weeks ago

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.