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

Authentication cookie for Tor does not match expected value - prevents mobile app from start sometimes #297

Closed
siepra opened this issue Mar 3, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@siepra
Copy link
Contributor

siepra commented Mar 3, 2022

No description provided.

@siepra siepra self-assigned this Mar 4, 2022
@siepra siepra added the bug Something isn't working label Mar 18, 2022
@siepra siepra removed their assignment Mar 18, 2022
@siepra siepra self-assigned this Mar 21, 2022
@siepra siepra removed their assignment Mar 21, 2022
@siepra
Copy link
Contributor Author

siepra commented Aug 24, 2022

Haven't seen for a while - moving back to backlog (possibly fixed by #296)

@siepra
Copy link
Contributor Author

siepra commented Sep 1, 2022

I confirm it happend to me again

@siepra siepra self-assigned this Sep 1, 2022
@siepra
Copy link
Contributor Author

siepra commented Sep 2, 2022

This problem happens randomly so it's hard to reproduce. I added some logging for checking if there's old tor process running, before launching a new one (I suspect that in some specific circumstances we try to authorize old tor with fresh cookie).
Also I implemented a mechanism for killing tor process when the app is being destroyed - it may prevent situations mentioned above

#872

@siepra
Copy link
Contributor Author

siepra commented Sep 14, 2022

I think we reproduced this problem with production build a few times recently.
The pattern is:

  1. User starts the app, uses it for a while and moves it to background
  2. User uses other applications
  3. Users tries to bring quiet app to foreground
  4. The app dies and starts successfully on another try

What I think happens is os kills the thread that runs react-native (the app starts with initial screen instead of coming back directly to the channel page) but tor process remains alive

@siepra siepra removed their assignment Sep 14, 2022
@EmiM EmiM self-assigned this Sep 21, 2022
@EmiM EmiM removed their assignment Sep 26, 2022
@EmiM
Copy link
Contributor

EmiM commented Sep 26, 2022

I didn't see the "authentication cookie" problem. I did experience app crashing but it may be caused by something else. Moving to the backlog.

@EmiM
Copy link
Contributor

EmiM commented Oct 10, 2022

I am encountering the cookie problem (mobile version 0.5.4-alpha.0)

10-10 10:36:31.231 19045 19253 E NODEJS-MOBILE: 2022-10-10T08:36:31.231Z backend:socket Launching community 1CDC003A22987689654653BCABC6D337 for Qmb5tdNiRFMVXv7NYP5Ms5pSJrNKJrm8DSq3JfJdcHVh5d
10-10 10:36:31.240 19045 19253 E NODEJS-MOBILE: 2022-10-10T08:36:31.240Z backend:communities Spawning hidden service for community 1CDC003A22987689654653BCABC6D337, peer: Qmb5tdNiRFMVXv7NYP5Ms5pSJrNKJrm8DSq3JfJdcHVh5d
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE: Error: TOR: Control port error: 515 Authentication failed: Authentication cookie did not match expected value.
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE: 
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE:     at Socket.<anonymous> (/data/data/com.zbaymobile/files/nodejs-project/lib/torManager/TorControl.js:41:32)
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE:     at Object.onceWrapper (events.js:421:26)
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE:     at Socket.emit (events.js:314:20)
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE:     at addChunk (_stream_readable.js:298:12)
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE:     at readableAddChunk (_stream_readable.js:273:9)
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE:     at Socket.Readable.push (_stream_readable.js:214:10)
10-10 10:36:31.262 19045 19253 E NODEJS-MOBILE:     at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
10-10 10:36:31.265 19045 19248 E nodejs  : /data/data/com.zbaymobile/files/nodejs-project/lib/libp2p/connectionsManager.js:232
10-10 10:36:31.265 19045 19248 E nodejs  :             throw new Error();
10-10 10:36:31.265 19045 19248 E nodejs  :             ^
10-10 10:36:31.265 19045 19248 E nodejs  : 
10-10 10:36:31.265 19045 19248 E nodejs  : Error
10-10 10:36:31.265 19045 19248 E nodejs  :     at process.<anonymous> (/data/data/com.zbaymobile/files/nodejs-project/lib/libp2p/connectionsManager.js:232:19)
10-10 10:36:31.265 19045 19248 E nodejs  :     at process.emit (events.js:314:20)
10-10 10:36:31.265 19045 19248 E nodejs  :     at processEmit [as emit] (/data/data/com.zbaymobile/files/nodejs-project/node_modules/signal-exit/index.js:199:34)
10-10 10:36:31.265 19045 19248 E nodejs  :     at processPromiseRejections (internal/process/promises.js:209:33)
10-10 10:36:31.265 19045 19248 E nodejs  :     at processTicksAndRejections (internal/process/task_queues.js:98:32)
--------- beginning of crash
10-10 10:36:31.276 19045 19067 F libc    : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x78ee9d8478)

@siepra
Copy link
Contributor Author

siepra commented Oct 25, 2022

After recent changes related to #916 this problem should be solved (0.5.4-alpha.3 and above)

@siepra siepra closed this as completed Oct 25, 2022
@holmesworcester holmesworcester moved this to Backlog - Mobile in Quiet Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants