openimsdk / open-im-server

IM Chat
https://openim.io
Apache License 2.0
13.83k stars 2.44k forks source link

invalid memory address or nil pointer dereference #1109

Closed lakerchen closed 1 year ago

lakerchen commented 1 year ago

What happened?

I'm trying to run the demo according to this instruction: source code deployment.

What did you expect to happen?

I try ./scripts/start-all.sh to start open-im-server, and I see errors like below

[root@smartx-test 2023-09-20 17:38:05 open-im-server]$ ./scripts/start-all.sh

# Begin to start all openim service scripts
All binaries have been installed in /root/open-im-server/_output/bin/platforms/linux/amd64ใ€‚
You need to start the following scripts in order: openim-api.sh openim-rpc.sh openim-push.sh openim-msgtransfer.sh openim-msggateway.sh openim-crontask.sh openim-tools.sh

## Pre Starting OpenIM services
/root/open-im-server/scripts/install//openim-tools.sh
Preparing to start OpenIM Tools...
Starting ncpu...
Starting PATH: /root/open-im-server/_output/bin/tools/linux/amd64/ncpu...
Specifying config: /root/open-im-server/config
Starting ncpu...
2Starting component...
Starting PATH: /root/open-im-server/_output/bin/tools/linux/amd64/component...
Specifying config: /root/open-im-server/config
Starting component...
Checking components Round 1...
Mysql starts successfully
Mongo starts successfully
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xed9e01]

goroutine 1 [running]:
main.exactIP({0xc0000468c0?, 0x3b9aca00?})
        /root/open-im-server/tools/component/component.go:122 +0x21
main.checkMinio()
        /root/open-im-server/tools/component/component.go:208 +0x2f5
main.main()
        /root/open-im-server/tools/component/component.go:102 +0x3c2
!!! [0920 17:38:19] Call tree:
!!! [0920 17:38:19]  1: /root/open-im-server/scripts/install//openim-tools.sh:123 openim::tools::start_service(...)
!!! [0920 17:38:19]  2: /root/open-im-server/scripts/install//openim-tools.sh:166 openim::tools::pre-start(...)
!!! Error in /root/open-im-server/scripts/install//openim-tools.sh:106 
  Error in /root/open-im-server/scripts/install//openim-tools.sh:106. '((i<4-1))' exited with status 2
Call stack:
  1: /root/open-im-server/scripts/install//openim-tools.sh:106 openim::tools::start_service(...)
  2: /root/open-im-server/scripts/install//openim-tools.sh:123 openim::tools::pre-start(...)
  3: /root/open-im-server/scripts/install//openim-tools.sh:166 main(...)
Exiting with status 1
!!! Error in ./scripts/start-all.sh:78 
  Error in ./scripts/start-all.sh:78. '${TOOLS_START_SCRIPTS_PATH} openim::tools::pre-start' exited with status 1
Call stack:
  1: ./scripts/start-all.sh:78 main(...)
Exiting with status 1

How can we reproduce it (as minimally and precisely as possible)?

Follow the documentation step by step

Anything else we need to know?

No response

version

release-3.3

Cloud provider

minio at localhost

OS version

NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"

Install tools

kubbot commented 1 year 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.

FGadvancer commented 1 year ago

ๅพฎไฟกๆˆชๅ›พ111111_20230920181908

Please check the URL address shown in the image and replace it with your public IP address. This bug has already been fixed by #1104 . https://github.com/openimsdk/open-im-server/pull/1104/files#diff-6c0a0afa2d2bcd7f35daca2267f8730ccc0f6d336879b3168adcb9112f338203

lakerchen commented 1 year ago

@FGadvancer Thank you very much! I have replaced signEndpoint to http://my IP:10005 and it works now.

But there is still another problem. I ran the command ./scripts/check-all.sh and then got errors:

$ ./scripts/check-all.sh

# Begin to check all openim service
./scripts/check-all.sh: line 36: local: -n: invalid option
local: usage: local [option] name[=value] ...
!!! [0921 11:16:27] Call tree:
!!! [0921 11:16:27]  1: ./scripts/check-all.sh:52 print_services_and_ports(...)
!!! Error in ./scripts/check-all.sh:36 
  Error in ./scripts/check-all.sh:36. '((i<3-1))' exited with status 2
Call stack:
  1: ./scripts/check-all.sh:36 print_services_and_ports(...)
  2: ./scripts/check-all.sh:52 main(...)
Exiting with status 1
FGadvancer commented 1 year ago

This is a bash version question has been discussed in detail in issue #1085, causing the check script to be ineffective. We will fix it later. you can also use ps -axu | grep openim to determine if the process has fully started. 124234324_20230921131056

lakerchen commented 1 year ago

OK, Thanks ๐Ÿ‘

kubbot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


OK, Thanks ๐Ÿ‘

BobBaoDengKe commented 10 months ago

ไฟฎๆ”น่ฟ™ไธช้…็ฝฎๆ–‡ไปถไธ‹็š„ไธคๅค„้…็ฝฎ๏ผš openim-server/release-v3.3/config/config.yaml clipbord_1699496992486 ๆ›ดๆขไธบ้ƒจ็ฝฒๆœบๅ™จ็š„IPๅœฐๅ€ ้‡ๆ–ฐๅฏๅŠจๆœๅŠกๅณๅฏ docker-compose down docker-compose up -d

kubbot commented 10 months ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Modify two configurations under this configuration file: openim-server/release-v3.3/config/config.yaml clipbord_1699496992486 Replace with the IP address of the deployment machine Just restart the service docker-compose down docker-compose up -d