signalapp / Signal-iOS

A private messenger for iOS.
https://signal.org
GNU Affero General Public License v3.0
10.6k stars 2.95k forks source link

409 error regardless of username #5698

Closed dirkx closed 7 months ago

dirkx commented 7 months ago

Bug description

In todays staging build - all attempts to register a username (even when the username is a uuid/sha256 or something really random) are met with a 'not available' message

Steps to reproduce

Error that username is not available in red.

Console log shows

2023-11-10 13:35:36:737 Signal[97188:4435476] 🧑 [OWSUrlSession.swift:439 baseCompletionPromise(requestConfig:responseData:monitorId:)]: Request failed: HTTP 409; <OWSHttpHeaders: [Content-Length; Content-Type; Date; x-signal-timestamp: 1699619736730]>; https://chat.signal.org/v1/accounts/username_hash/reserve; nil
2023-11-10 13:35:36:737 Signal[97188:4435476] 🧑 [OWSUrlSession.swift:592 promiseForTSRequest(_:)]: Failure: { PUT: Optional(v1/accounts/username_hash/reserve) }, error: HTTP 409; <OWSHttpHeaders: [Content-Length; Content-Type; Date; x-signal-timestamp: 1699619736730]>; https://chat.signal.org/v1/accounts/username_hash/reserve; nil
2023-11-10 13:35:36:738 Signal[97188:4342334] 🧑 [UsernameSelectionViewController.swift:755 attemptReservationAndUpdateValidationState(forUsernameCandidates:)]: [Username] Reservation rejected. Attempt ID: 4A7FA652-90E2-4E95-A37E-301FCF4D6C5A 

Expected result:

Register a username - actual name was fully random so unlikely to be claimed.

Device info

Xcode emulator, iPhone 15 pro on ios 17.0 stock


2023/11/10 12:35:01:694  πŸ’š [Bench.swift:34 BenchAsync(title:logInProduction:block:)]: [Bench] title: <OWSSendMessageOperation: 0x119611060>-0x119611060, duration: 19.36ms
2023/11/10 12:35:01:695  πŸ’š [OWSOperation.m:50 -[OWSOperation dealloc]]: [<OWSSendMessageOperation: 0x119611060>]
2023/11/10 12:35:01:695  πŸ’š [OWSOperation.m:50 -[OWSOperation dealloc]]: [<SignalServiceKit.MessageSenderOperation: 0x119756340>]
2023/11/10 12:35:01:733  πŸ’™ [DatabaseChangeObserver.swift:559 publishUpdates(shouldPublishIfEmpty:)]: databaseChangesDidUpdate
2023/11/10 12:35:03:375  πŸ’› [UsernameSelectionViewController.swift:728 attemptReservationAndUpdateValidationState(forUsernameCandidates:)]: [Username] Attempting to reserve username. Attempt ID: [ REDACTED_UUID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxFDD ]
2023/11/10 12:35:03:375  πŸ’› [RESTNetworkManager.m:176 -[RESTNetworkManager makeRequestSync:completionQueue:success:failure:]]: Making Non-UD request: { PUT: Optional(v1/accounts/username_hash/reserve) }
2023/11/10 12:35:03:376  πŸ’™ [OWSUrlSession.swift:581 promiseForTSRequest(_:)]: Making request: { PUT: Optional(v1/accounts/username_hash/reserve) }
2023/11/10 12:35:03:483  πŸ’™ [HTTPUtils.m:95 +[HTTPUtils logCurlForURLRequest:]]: curl for request: curl -v -k -X PUT -H 'User-Agent: Signal-iOS/[ REDACTED_IPV4_ADDRESS:...6 ] iOS/17.0.1' -H 'Accept-Language: en-GB, en-NL;q=0.9, nl-NL;q=0.8, ru-NL;q=0.7' -H 'Content-Type: application/json' -H 'Authorization: Basic NjA1ZTU0NDItNzQwZC00Zjg1LWExNTItNWNjYTIwZjQxZmNlOjJlYzJhNDUxNWUyNGZlZWNiYzIxZGMyZjFlMzk5ZDhj' --data-ascii '{"usernameHashes":["LoEhwUxFuL3zObAjpToqTb2C4axfbhRoNc08L21EGRs","SJ_ymKQiMvYhN1SKNOzR5EgWiwjFh0bTgel0rOOL5SU","Bu3hXkTPFMjDOj_mwARbBCSjpI0QoNTTBcNaS6wme0Y","Uq5CgYoWMWG5s-AwaiphBqcBXLsSVWzdwa0SE3BtjmM","8HFJYRxqo07yvuSgS31qLsgvUWTwpVuv_jAFRAnhPDI","0q0Ea89MBlbZE0msD9H65yBW_8ugmbsVRE5DoHgHvCg","coNoRNNGBOq89_pjrYjlMJ9X45XVrtfgVkcCUGf1Wyw","_BdqmEoCZHoD_-vFT0KIGtKHIDmHi26Vjt6NIjuf2k4","OuWxsvm-MK02J2j3miIwqE8p8DTeK81Q3-NQ8znpOns","GjGVhnfiAvKR1GYiYswCuFagjwo2Rni-QhqS4mUgnkI","_kwTmI7-wi1x6EWjCZVFTlGZ2cERZ-ijMsXub8_CXnU","mloN9BNaOW4ejmS0qibJ3omAQd3zckwgIiecDfyPJB0","PHMm9-5S68OnZcIPS8vaq0QZMqieU-nDKyczWEmtHHw","luVTdgBXvn8QwA3qOHKGcvhQKq24VrSbeRPUD8UgRTU","JAdVAklik89DPRdXF499ny0-wSPHlQN0ExeK-7ARjFU","MDcskHNJkC4sFE8ISncOH84muFzIcPiop8-f7T7tcGs","aDmqXEHVztlICfN3rxXpGSft5-yHr2lzAqMEUWwJBkY","DicCBNr7Qdng7tS8nvcjfyZ-Cm67NLNG79DxtImlV1w","qLRvkr529gc8jATkRzuCXBvMRJQJkt1tHAxj7ggHxzo","lKy0f5TFOZFSJsE-21c4XJyk7aWp31liWWw9dg1MJVY"]}' "https://chat.signal.org/v1/accounts/username_hash/reserve"
2023/11/10 12:35:03:483  πŸ’™ [OWSUrlSession.swift:428 baseCompletionPromise(requestConfig:responseData:monitorId:)]: Status code: 409
2023/11/10 12:35:03:487  🧑 [OWSUrlSession.swift:439 baseCompletionPromise(requestConfig:responseData:monitorId:)]: Request failed: HTTP 409; <OWSHttpHeaders: [Content-Length; Content-Type; Date; x-signal-timestamp: 1699619703473]>; https://chat.signal.org/v1/accounts/username_hash/reserve; nil
2023/11/10 12:35:03:487  🧑 [OWSUrlSession.swift:592 promiseForTSRequest(_:)]: Failure: { PUT: Optional(v1/accounts/username_hash/reserve) }, error: HTTP 409; <OWSHttpHeaders: [Content-Length; Content-Type; Date; x-signal-timestamp: 1699619703473]>; https://chat.signal.org/v1/accounts/username_hash/reserve; nil
2023/11/10 12:35:03:489  🧑 [UsernameSelectionViewController.swift:755 attemptReservationAndUpdateValidationState(forUsernameCandidates:)]: [Username] Reservation rejected. Attempt ID: [ REDACTED_UUID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxFDD ]  
2023/11/10 12:35:10:188  πŸ’› [UsernameSelectionViewController.swift:728 attemptReservationAndUpdateValidationState(forUsernameCandidates:)]: [Username] Attempting to reserve username. Attempt ID: [ REDACTED_UUID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx388 ]
2023/11/10 12:35:10:188  πŸ’› [RESTNetworkManager.m:176 -[RESTNetworkManager makeRequestSync:completionQueue:success:failure:]]: Making Non-UD request: { PUT: Optional(v1/accounts/username_hash/reserve) }
sashaweiss-signal commented 7 months ago

Hi! Can you confirm that this build was in fact pointing at staging? All username requests will 409 in production, so I'm wondering if these logs were from a build inadvertently pointed at production.

max-signal commented 7 months ago

The app sent a request to https://chat.signal.org/v1/accounts/username_hash/reserve, which is the production endpoint. If it were staging, it’d be https://chat.staging.signal.org.

sashaweiss-signal commented 7 months ago

Thanks Max, good catch. I'm going to close this for the moment, as it appears the build in question was in fact pointing at prod rather than staging.