8go / matrix-commander

simple but convenient CLI-based Matrix client app for sending and receiving
GNU General Public License v3.0
551 stars 59 forks source link

Unable to verify #171

Closed Chi-bz closed 6 days ago

Chi-bz commented 5 months ago

Hi, I've been having issues trying to verify. I installed matrix-command through pip in a Python env and was able to successfully send a test message. However, I've been unable to get it verified trying both the Elements web-app in two different installations of Firefox, as well as their Flatpak app.

Upon clicking the “Interactively verify by emoji” button through the room-info panel, the window for verification disappears and shows no signs of working. I was able to use the exact same method to verify other clients to confirm it wasn't an issue regarding the Elements apps. So I'm assuming there's an issue on the matrix-command side, whether that be user error or otherwise, I'm not quite sure.


$ matrix-commander --verify emoji
matrix-commander is ready and waiting for the other party to initiate an emoji verification with us by selecting 'Verify by Emoji' in their Matrix client. Read --verify instructions in --manual carefully to assist you in how to do this quickly.
2024-03-19 02:10:18,725:     INFO: nio.client.base_client: New joined room room_string:matrix.org
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type PowerLevelsEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RedactedEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RedactedEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RedactedEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RedactedEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomCreateEvent
2024-03-19 02:10:18,726:     INFO: nio.client.base_client: New joined room room_string:matrix.org
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomHistoryVisibilityEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomCreateEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomEncryptionEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomGuestAccessEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type PowerLevelsEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Changing power level for user @acct:matrix.org from 0 to 100
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Changing power level for user @bot_acct:matrix.org from 0 to 100
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomJoinRulesEvent
2024-03-19 02:10:18,726:     INFO: nio.client.base_client: New joined room room_string:matrix.org
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomNameEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomSpaceParentEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RedactedEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomJoinRulesEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomEncryptionEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomHistoryVisibilityEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomGuestAccessEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type RoomCreateEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Room room_string:matrix.org handling event of type PowerLevelsEvent
2024-03-19 02:10:18,726:     INFO:        nio.rooms: Changing power level for user @acct:matrix.org from 0 to 100
0x766C70 commented 5 months ago

got this message when initiating verification from browser:

ERROR: matrix-commander: E110: Verification has been cancelled by @user:matrix.localinstance.com for reason "The user cancelled the verification.".

spacefrogg commented 5 months ago

I tried to use --verify together with --login and used the steps according to the --manual. This got me here:

2024-04-12 11:38:26,500:    ERROR: matrix-commander: E108: accept_key_verification failed with error 'ToDeviceError: M_UNKNOWN Internal server error - retry after ToDeviceMessage(type='m.key.verification.accept', recipient='<redacted>', recipient_device='<redacted>', content={'transaction_id': 'jBGTvgYL6RlbH7ejcWTXGZfD2UHEWVoB', 'key_agreement_protocol': 'curve25519-hkdf-sha256', 'hash': 'sha256', 'message_authentication_code': 'hkdf-hmac-sha256', 'short_authentication_string': ['emoji', 'decimal'], 'commitment': '<redacted>'})ms'.
2024-04-12 11:38:26,522:  WARNING:    nio.responses: Error validating response: Additional properties are not allowed ('errcode', 'error' were unexpected)
2024-04-12 11:38:26,522:    ERROR: matrix-commander: E109: to_device failed with error 'ToDeviceError: M_UNKNOWN Internal server error - retry after ToDeviceMessage(type='m.key.verification.key', recipient='<redacted>', recipient_device='<redacted>', content={'transaction_id': 'jBGTvgYL6RlbH7ejcWTXGZfD2UHEWVoB', 'key': '<redacted>'})ms'.
2024-04-12 11:39:26,663:    ERROR: matrix-commander: E110: Verification has been cancelled by <redacted> for reason "Timed out".
2024-04-12 11:39:26,757:  WARNING:    nio.responses: Error validating response: Additional properties are not allowed ('errcode', 'error' were unexpected)

The verification on the browser window keeps spinning endlessly (waiting for an emoji response from matrix-commander). It seems that matrix-commander is not compatible with the latest protocol and chokes on newly added fields errcode and error.

ytdugtzalgjdre commented 4 months ago

hi. same problem. is there a way to verify? looks like emoji is the only one way to verify but it doesn't work

garryavx commented 4 months ago

Same issue, tried in element web on firefox and element desktop on win11. I initiate the verification request from the element client in the sessions section of settings, then run matrix-commander -c /home/nagios/.config/matrix-commander/store/credentials.json -s /home/nagios/.config/matrix-commander/ --verify

I get " ERROR: matrix-commander: E110: Verification has been cancelled by @nagiosrelay:matrix.org for reason "The user cancelled the verification."." then it just hangs.

If I wait long enough it times out in element and if I start it from fresh I dont get the cancelled notification but instead it just never does anything. I get the initial message from matrix commander "matrix-commander is ready and waiting for the other party to initiate an emoji verification with us by selecting 'Verify by Emoji' in their Matrix client. Read --verify instructions in --manual carefully to assist you in how to do this quickly."

then just stuff related to rooms.

thehecki commented 4 months ago

same problem for me, no reaction after start emoji verify

in one of my trys i become additional warnings:

WARNING: nio.crypto.log: Received a undecryptable Megolm event from a unknown device: @xxxxxxx:matrix.org XXXXXXX WARNING: nio.crypto.log: Error decrypting megolm event, no session found with session id xxxxxxxx for room xxxxxxx:matrix.org

TorstenC commented 3 months ago

Similar problem:

nio.crypto.log: Received key verification event with an unknown transaction id from @xxxx:matrix.xxxx.de
oddfellow commented 3 months ago

I used the Element Web Client from a different IP address than the one from matrix-commander and then emoji verification worked as described in matrix-commander --manual

Trying to verify from the same IP address resulted in the problems described above.

I could reproduce this two times in a row.

bpbradley commented 3 months ago

I used the Element Web Client from a different IP address than the one from matrix-commander and then emoji verification worked as described in matrix-commander --manual

Trying to verify from the same IP address resulted in the problems described above.

I could reproduce this two times in a row.

Doesn't work for me. Having the same issues as described by others.

tionis commented 3 months ago

Same here

SuperdukeGates commented 3 months ago

I used the Element Web Client from a different IP address than the one from matrix-commander and then emoji verification worked as described in matrix-commander --manual

Trying to verify from the same IP address resulted in the problems described above.

I could reproduce this two times in a row.

No help. :(

HiFiJ commented 3 months ago

Hi, I have been trying hard to get a successfull verififcation via emoji verification initiated by the Element Web App, but can not get any reaction on the matrx-commander side. Is there anything special regarding this combination or other clue on how to verify the matrix-commander device? Thanks a lot, Joost

I tried on Manjaro and on up-to-date IPFire (via pip):

 ~/Software/Python/matric-commander: matrix-commander --verify emoji                                                                                                                                                                                                                    
matrix-commander is ready and waiting for the other party to initiate an emoji verification with us by selecting 'Verify by Emoji' in their Matrix client. Read --verify instructions in --manual carefully to assist you in how to do this quickly.
bpbradley commented 3 months ago

I was able to figure it out. There were changes to how emoji verification works many months ago on the matrix side. The events needed to handle this process don't exist in matrix nio. I was able to get it to work using an unknown event callback and filtering for the correct events. Will try to see if there is a way to patch it into matrix-commander this week if I get some time.

But yeah --verify will not work in the meantime with an up to date matrix server.

At last though, I have a verified session...

HiFiJ commented 3 months ago

Hi, this sounds great! I hope to use matrix-commander integrated in a headless server setup, so verification would be really nice to have.

8go commented 6 days ago

I am closing this issue because I want to concentrate all verify-related issue in one single issue.

Please continue any "verify" or "verification" related issue in Issue #182.