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

telegram whatsapp bridge: [Client ERROR] Client outdated (405) connect failure #2175

Closed
fabio841 opened this issue Aug 21, 2024 · 24 comments
Closed
Labels

Comments

@fabio841
Copy link

0000] INFO main: Running version 1.26.0
[0000] INFO router: Parsing gateway gateway1
[0000] INFO router: Starting bridge: whatsapp.mywhatsapp
13:36:59.744 [Client ERROR] Client outdated (405) connect failure
[0003] INFO whatsapp: QR channel result: err-client-outdated
[0005] INFO whatsapp: WhatsApp connection successful
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x12f5042]

goroutine 1 [running]:
github.com/42wim/matterbridge/bridge/whatsappmulti.(*Bwhatsapp).Connect(0xc000358fc0)
/root/go/pkg/mod/github.com/42wim/matterbridge@v1.26.0/bridge/whatsappmulti/whatsapp.go:119 +0x622
github.com/42wim/matterbridge/gateway.(*Router).Start(0xc000108780)
/root/go/pkg/mod/github.com/42wim/matterbridge@v1.26.0/gateway/router.go:76 +0x35f
main.main()
/root/go/pkg/mod/github.com/42wim/matterbridge@v1.26.0/matterbridge.go:65 +0x39e

Why have this error ?
I have launch command ./matterbridge -conf matterbridge.toml

@fabio841 fabio841 added the bug label Aug 21, 2024
@fabio841
Copy link
Author

fabio841 commented Aug 21, 2024

solve incredible need update go!!!!!!
First check version. send command
go version
if is old need update.

command is
sudo snap install go --classic

if not work or have other bersion need remove before
use:
sudo apt-get purge golang-go
sudo apt-get autoremove
$ rm -rf /usr/lib/go
$ rm -rf /usr/lib/go-1.13
$ rm -rf /usr/share/go
$ rm -rf /usr/share/go-1.13
git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh

restart ubuntu
now verify if version is update by command "go version"

later send command:
sudo CGO_ENABLED=0 go install -tags nomsteams,whatsappmulti,nozulip github.com/42wim/matterbridge@master

if continue have problem with go module (go: command not found) need add this line in 2 file:
profile and bash.bashrc:

write in terminal:
sudo nano /etc/profile
and add in bottom line
export PATH=$PATH:/usr/local/go/bin
CTRL+X save
later
sudo nano /etc/bash.bashrc
and add in bottom line
export PATH=$PATH:/usr/local/go/bin
CTRL+X save

now reboot: sudo reboot
send command:
sudo CGO_ENABLED=0 go install -tags whatsappmulti github.com/42wim/matterbridge@master
enter in folder home/go/bin

start command:
./matterbridge -debug -conf matterbridge.toml

QR CODE IS OK!!!!!

@mujeebcpy
Copy link

i updated everything but still getting error.

10:50:11.337 [Client/Socket ERROR] Error reading from websocket: websocket: close 1006 (abnormal closure): unexpected EOF
[0002]  INFO whatsapp:     [Connect:/home/nivadaily/go/pkg/mod/github.com/42wim/matterbridge@v1.26.1-0.20240524210809-d16645c9527a/bridge/whatsappmulti/whatsapp.go:106] QR channel result: timeout
10:50:11.338 [Client ERROR] Client outdated (405) connect failure (client version: 2.2412.50)
[0003]  INFO whatsapp:     [Connect:/home/nivadaily/go/pkg/mod/github.com/42wim/matterbridge@v1.26.1-0.20240524210809-d16645c9527a/bridge/whatsappmulti/whatsapp.go:123] WhatsApp connection successful
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1477e66]

goroutine 1 [running]:
github.com/42wim/matterbridge/bridge/whatsappmulti.(*Bwhatsapp).Connect(0xc0000b0cc0)
        /home/nivadaily/go/pkg/mod/github.com/42wim/matterbridge@v1.26.1-0.20240524210809-d16645c9527a/bridge/whatsappmulti/whatsapp.go:125 +0x5e6
github.com/42wim/matterbridge/gateway.(*Router).Start(0xc00040ccd0)
        /home/nivadaily/go/pkg/mod/github.com/42wim/matterbridge@v1.26.1-0.20240524210809-d16645c9527a/gateway/router.go:76 +0x345
main.main()
        /home/nivadaily/go/pkg/mod/github.com/42wim/matterbridge@v1.26.1-0.20240524210809-d16645c9527a/matterbridge.go:65 +0x394

@fabio841
Copy link
Author

fabio841 commented Aug 23, 2024

Have restart linux ? send sudo reboot command
Try use this format into matterbridge.toml (change XXXXXXXXX with your data)

[telegram.mytelegram]
Token="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
#Create new TG bot and put the API token above.

RemoteNickFormat="<{NICK}> "
MessageFormat="HTMLNick >"

[whatsapp.mywhatsapp]
Number="+XXXXXXXX" #insert mobile number in IDC format
SessionFile="session-XXXXXXX.gob" ###insert mobile number in IDC format
QrOnWhiteTerminal=false

[[gateway]]
name="gateway1"
enable=true

[[gateway.inout]]
account="whatsapp.mywhatsapp"
channel="XXXXXXXXXXXXX@g.us"
###Essentially this is the 'ChatID' equivalent to TG. To obtain it is a little convoluted. Follow the steps from the video below
###https://www.youtube.com/watch?v=W-VXISoKtNc

[[gateway.inout]]
account="telegram.mytelegram"
channel="-XXXXXXXXXXXX" #TG Group Chat ID. You will need to create a new Group Chat, assign the TG BOT created above to it and make it an admin of that group too.

@Vetgans
Copy link

Vetgans commented Aug 23, 2024

Can confirm what @mujeebcpy experienced. I built the app with updated go as well, but got the same errors as described.

I'm bridging whatsapp to matrix, and at first sight it looks like whatsmeow has to be updated.

@paxaman
Copy link

paxaman commented Aug 23, 2024

same problem here. go update not solved the problem

[Client/Socket ERROR] Error reading from websocket: websocket: close 1006 (abnormal closure): unexpected EOF

@fabio841
Copy link
Author

fabio841 commented Aug 23, 2024

first restart, send:

$sudo reboot
later
check version.
send command:
$ go version
If no have 1.23 there is a problem

@Vetgans
Copy link

Vetgans commented Aug 23, 2024

If no have 1.23 there is a problem

I did exactly as you told, used version 1.23.0, to no success.

@IntGrah
Copy link

IntGrah commented Aug 23, 2024

I guess this is a dirty fix, the actual solution would be to bump the whatsmeow version. If you need a working binary asap, just clone my fork, and run go install -tags whatsappmulti,nomsteams,nozulip

@Vetgans
Copy link

Vetgans commented Aug 23, 2024

Thanks for your effort! But a problem with the path occurs:

go install -tags nomsteams,nozulip,whatsappmulti github.com/IntGrah/matterbridge@master
go: downloading github.com/IntGrah/matterbridge v0.0.0-20240823131055-5a0dade4652c
go: github.com/IntGrah/matterbridge@master: version constraints conflict:
github.com/IntGrah/matterbridge@v0.0.0-20240823131055-5a0dade4652c: parsing go.mod:
module declares its path as: github.com/42wim/matterbridge
but was required as: github.com/IntGrah/matterbridge

Maybe you could change that as well?

@IntGrah
Copy link

IntGrah commented Aug 23, 2024

Thanks for your effort! But a problem with the path occurs:

go install -tags nomsteams,nozulip,whatsappmulti github.com/IntGrah/matterbridge@master go: downloading github.com/IntGrah/matterbridge v0.0.0-20240823131055-5a0dade4652c go: github.com/IntGrah/matterbridge@master: version constraints conflict: github.com/IntGrah/matterbridge@v0.0.0-20240823131055-5a0dade4652c: parsing go.mod: module declares its path as: github.com/42wim/matterbridge but was required as: github.com/IntGrah/matterbridge

Maybe you could change that as well?

go install -tags <tags> <remote repo> doesn't seem to work with forks. You have to clone the repo first, and then run go install -tags <tags> without any additional args. Hope this helps.

@naveenyeluru
Copy link

naveenyeluru commented Aug 23, 2024

@IntGrah Getting import lookup disabled error while installing post cloning the repo
Snip20240823_1

@IntGrah
Copy link

IntGrah commented Aug 23, 2024

@IntGrah Getting import lookup disabled error while installing post cloning the repo Snip20240823_1

My bad, I was messing around with changing the module name. It should work now.

@Vetgans
Copy link

Vetgans commented Aug 23, 2024

My bad, I was messing around with changing the module name. It should work now.

And it does!! Many thanks for your efforts. 👍

@naveenyeluru
Copy link

@IntGrah Getting import lookup disabled error while installing post cloning the repo Snip20240823_1

My bad, I was messing around with changing the module name. It should work now.

Its working now, thank you :)

@mujeebcpy
Copy link

@fabio841 Happy to see you are suggesting to view a video made by me 😄 ibcomputing is my channel and i made that tutorial

@fabio841
Copy link
Author

fabio841 commented Aug 23, 2024

thanks @mujeebcpy
Guys, if you have any concerns, the possibility of forwarding messages between a WhatsApp channel instead of a group should be implemented. In this regard, if it can be useful, I found this interesting discussion which allows you to extract the channel JID: WhiskeySockets/Baileys#549

essentially the channel has an ID that can be easily searched via developer console and WhatsApp web and ends with @newslatter.

Do you think this feature could be added? This would make it possible to use a channel instead of a group. I tried replacing the "TG Group Chat ID" of the group that ends in @g.us with ID @newslatter in the matterbridge.toml file but it doesn't work.

@mujeebcpy
Copy link

@fabio841 ya. sending to channel is must now. i manage telegram channel so if i can use matterbridge to update my whatsapp channel in realtime it will be excellent.

@fabio841
Copy link
Author

only @42wim can help

@Draganis
Copy link

I have the exact same problem using Windows with go 1.23
Is there any solution by now?

@IntGrah
Copy link

IntGrah commented Aug 24, 2024

I have the exact same problem using Windows with go 1.23
Is there any solution by now?

My fork has a temporary fix. Clone it and then run go install -tags whatsappmulti in the directory

@Draganis
Copy link

Thank you. It works now...

@fabio841
Copy link
Author

fabio841 commented Aug 24, 2024

@IntGrah you think it's possible adding feature for bridge channel ? (no group) I tried replacing the "TG Group Chat ID" of the group that ends in @g.us with ID @newslatter in the matterbridge.toml file but it doesn't work.

This was referenced Aug 26, 2024
@fabio841
Copy link
Author

it's possible usa https://github.com/pedroslopez/whatsapp-web.js for adding bridge with channel instead whatsmeow ?

@42wim
Copy link
Owner

42wim commented Aug 27, 2024

Fixed in master now

@42wim 42wim closed this as completed Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants