telegram-s / telegram-bot

32 stars 23 forks source link

Error in switchDC #4

Open Semro007 opened 10 years ago

Semro007 commented 10 years ago

Hello,

I'm trying to run this program but i recive a NullPointerException in switchDC phase.

Execution program log:

Use test DC? (write test for test servers): Using production servers TelegramApi#1001:Phase 0 in 16 ms TelegramApi#1001:Phase 1 in 437 ms TelegramApi#1001:Timeout Iteration TelegramApi#1001:Connection iteration TelegramApi#1001:#1: waitForDc TelegramApi#1001:#1: Creating proto for dc TelegramApi#1001:#1: Creating key TelegramApi#1001:Phase 2 in 47 ms TelegramApi#1001:Sender iteration api#1001#Downloader:DownloadFileThread iteration api#1001#Downloader:DownloadFileThread iteration api#1001#Downloader:DownloadFileThread iteration api#1001#Downloader:DownloadFileThread iteration api#1001#Uploader:UploadFileThread iteration api#1001#Uploader:UploadFileThread iteration api#1001#Uploader:UploadFileThread iteration api#1001#Uploader:UploadFileThread iteration TelegramApi#1001:Phase 3 in 94 ms Loading fresh DC list...TelegramApi#1001:Timeout Iteration TelegramApi#1001:Sender iteration TelegramApi#1001:>> #0: help.getConfig#c4f9186b TransportRate:Transport: #1 173.240.5.1:443 #1.0 TransportRate:tryConnection #1 TransportRate:onConnectionSuccess #1 TransportRate:Transport: #1 173.240.5.1:443 #1.0 Authorizer:Solved PQ in 313 ms TransportRate:Transport: #1 173.240.5.1:443 #1.0 TransportRate:Transport: #1 173.240.5.1:443 #1.0 ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector TransportRate:Transport: #1 173.240.5.1:443 #1.0 ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector TransportTcpPool#1002:Creating context... ActorDispatcher:Dispatching action: pingDelay for internal_actions TransportTcpPool#1003:Creating context... ActorDispatcher:Dispatching action: requestSalts for internal_actions TransportRate:tryConnection #1 TransportRate:tryConnection #1 ActorDispatcher:Dispatching action: pingDelay for internal_actions MTProto#1002:Ping delay disconnect for 75 sec ActorDispatcher:Dispatching action: pingDelay for internal_actions MTProto#1002:sendMessage #5 account.registerDevice#446c712c ActorDispatcher:Dispatching action: requestSalts for internal_actions MTProto#1003:Salt check timeout MTProto#1001:Salt check timeout MTProto#1003:Too few actual salts: 0, requesting news MTProto#1001:Too few actual salts: 0, requesting news ActorDispatcher:Dispatching action: schedule for scheduller TelegramApi#1001:#MTProto #1002 created in 2719 ms ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: requestSalts for internal_actions MTProto#1002:Salt check timeout MTProto#1002:Too few actual salts: 0, requesting news TelegramApi#1001:Connection iteration ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller TelegramApi#1001:Connection iteration ActorDispatcher:Dispatching action: schedule for scheduller TelegramApi#1001:Sender iteration ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector MTProto#1001:sendMessage #11 help.getConfig#c4f9186b TransportTcpPool#1001:Creating context... TelegramApi#1001:#> #0 sent to MTProto #1001 with id #11 TelegramApi#1001:Sender iteration TransportRate:tryConnection #1 TransportTcpPool#1003:Context created. TransportTcpPool#1001:Context created. ActorDispatcher:Dispatching action: schedule for scheduller TransportTcpPool#1002:Context created. ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector MTProto#1003#Scheduller:Forgetting message: #4 MTProto#1001#Scheduller:Forgetting message: #2 MTProto#1002#Scheduller:Forgetting message: #3 Scheduller:Prepare package: ping#7abe77ec of size 12 Scheduller:Total size: 12 Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 20 Scheduller:Prepare package: ping#7abe77ec of size 12 Scheduller:Total size: 32 MTProto#1003#Scheduller:Iteration: count: 3, confirm:0 MTProto#1003#Scheduller:Building package Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 8 Scheduller:Prepare package: account.registerDevice#446c712c of size 96 Scheduller:Prepare package: help.getConfig#c4f9186b of size 40 Scheduller:Total size: 96 Scheduller:Total size: 48 Scheduller:Prepare package: ping_delay_disconnect#f3427b8c of size 16 Scheduller:Total size: 112 Scheduller:Prepare package: ping#7abe77ec of size 12 Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 120 Scheduller:Total size: 60 Scheduller:Prepare package: ping#7abe77ec of size 12 MTProto#1001#Scheduller:Iteration: count: 3, confirm:0 MTProto#1001#Scheduller:Building package Scheduller:Total size: 132 MTProto#1002#Scheduller:Iteration: count: 4, confirm:0 MTProto#1002#Scheduller:Building package MTProto#1002#Scheduller:Adding msg_ack: 0 MTProto#1003#Scheduller:Adding msg_ack: 0 MTProto#1001#Scheduller:Adding msg_ack: 0 MTProto#1003#Scheduller:Adding package: #6 ping#7abe77ec (6000607884231049220, 1) MTProto#1001#Scheduller:Adding package: #9 get_future_salts#b921bd04 (6000607884231049224, 1) MTProto#1002#Scheduller:Adding package: #5 account.registerDevice#446c712c (6000607884231049220, 1) MTProto#1003#Scheduller:Adding package: #8 get_future_salts#b921bd04 (6000607884231049228, 3) MTProto#1002#Scheduller:Adding package: #7 ping_delay_disconnect#f3427b8c (6000607884231049232, 3) MTProto#1001#Scheduller:Adding package: #11 help.getConfig#c4f9186b (6000607884231049228, 3) MTProto#1003#Scheduller:Adding package: #12 ping#7abe77ec (6000607884231049236, 5) MTProto#1001#Scheduller:Adding package: #13 ping#7abe77ec (6000607884231049244, 5) MTProto#1002#Scheduller:Adding package: #10 get_future_salts#b921bd04 (6000607884231049240, 5) MTProto#1001#Scheduller:Sending Package (6000607884231049252, 6) MTProto#1003#Scheduller:Sending Package (6000607884231049248, 6) MTProto#1002#Scheduller:Adding package: #14 ping#7abe77ec (6000607884231049256, 7) MTProto#1002#Scheduller:Sending Package (6000607884231049260, 8) TransportTcpPool#1001:Creating context... TransportRate:tryConnection #1 TransportTcpPool#1001:Context created. ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: ping#7abe77ec of size 12 Scheduller:Total size: 12 MTProto#1001#Scheduller:Iteration: count: 1, confirm:0 ActorDispatcher:Dispatching action: schedule for scheduller MTProto#1001#Scheduller:Building package MTProto#1001#Scheduller:Single package: #15 ping#7abe77ec (6000607884231049264, 7) ActorDispatcher:Dispatching action: schedule for scheduller MTProto#1001#Transport4:Start reading message: pre MTProto#1001#Transport4:Start reading message: 88 MTProto#1002#Transport3:Start reading message: pre MTProto#1003#Transport2:Start reading message: pre MTProto#1002#Transport3:Start reading message: 88 MTProto#1003#Transport2:Start reading message: 88 TransportTcpPool#1003:onSuccess TransportTcpPool#1002:onSuccess TransportTcpPool#1002:reset TransportTcpPool#1001:onSuccess TransportTcpPool#1001:reset TransportTcpPool#1003:reset TransportRate:onConnectionSuccess #1 TransportRate:onConnectionSuccess #1 TransportRate:Transport: #1 173.240.5.1:443 #1.0 TransportRate:onConnectionSuccess #1 TransportRate:Transport: #1 173.240.5.1:443 #1.0 TransportRate:Transport: #1 173.240.5.1:443 #1.0 ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response MTProto#1002:MTProtoMessage: bad_server_salt#edab447b MTProto#1001:MTProtoMessage: bad_server_salt#edab447b MTProto#1003:MTProtoMessage: bad_server_salt#edab447b MTProto#1001:BadMessage: 48 #6000607884231049252 MTProto#1002:BadMessage: 48 #6000607884231049260 MTProto#1003:BadMessage: 48 #6000607884231049248 MTProto#1001:Reschedule messages because bad_server_salt #6000607884231049252 MTProto#1003:Reschedule messages because bad_server_salt #6000607884231049248 MTProto#1002:Reschedule messages because bad_server_salt #6000607884231049260 MTProto#1003#Scheduller:Resending as new #6 MTProto#1001#Scheduller:Resending as new #9 MTProto#1003#Scheduller:Resending as new #8 MTProto#1002#Scheduller:Resending as new #5 MTProto#1003#Scheduller:Resending as new #12 MTProto#1001#Scheduller:Resending as new #11 ActorDispatcher:Dispatching action: schedule for scheduller MTProto#1002#Scheduller:Resending as new #7 MTProto#1001#Scheduller:Resending as new #13 Scheduller:Prepare package: ping#7abe77ec of size 12 MTProto#1002#Scheduller:Resending as new #10 Scheduller:Total size: 12 ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 20 Scheduller:Prepare package: ping#7abe77ec of size 12 MTProto#1002#Scheduller:Resending as new #14 Scheduller:Total size: 32 ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 MTProto#1003#Scheduller:Iteration: count: 3, confirm:0 MTProto#1003#Scheduller:Building package Scheduller:Prepare package: account.registerDevice#446c712c of size 96 MTProto#1003#Scheduller:Adding package: #6 ping#7abe77ec (6000607888526016512, 7) Scheduller:Total size: 8 Scheduller:Total size: 96 MTProto#1003#Scheduller:Adding package: #8 get_future_salts#b921bd04 (6000607888526016516, 9) Scheduller:Prepare package: help.getConfig#c4f9186b of size 40 MTProto#1003#Scheduller:Adding package: #12 ping#7abe77ec (6000607888526016520, 11) Scheduller:Prepare package: ping_delay_disconnect#f3427b8c of size 16 MTProto#1003#Scheduller:Sending Package (6000607888526016524, 12) Scheduller:Total size: 48 Scheduller:Total size: 112 Scheduller:Prepare package: ping#7abe77ec of size 12 Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 60 Scheduller:Total size: 120 MTProto#1001#Scheduller:Iteration: count: 3, confirm:0 MTProto#1001#Scheduller:Building package Scheduller:Prepare package: ping#7abe77ec of size 12 Scheduller:Total size: 132 MTProto#1001#Scheduller:Adding package: #9 get_future_salts#b921bd04 (6000607888526016528, 9) MTProto#1002#Scheduller:Iteration: count: 4, confirm:0 MTProto#1002#Scheduller:Building package MTProto#1001#Scheduller:Adding package: #11 help.getConfig#c4f9186b (6000607888526016532, 11) MTProto#1002#Scheduller:Adding package: #5 account.registerDevice#446c712c (6000607888526016536, 9) MTProto#1001#Scheduller:Adding package: #13 ping#7abe77ec (6000607888526016540, 13) MTProto#1002#Scheduller:Adding package: #7 ping_delay_disconnect#f3427b8c (6000607888526016544, 11) MTProto#1001#Scheduller:Sending Package (6000607888526016548, 14) MTProto#1002#Scheduller:Adding package: #10 get_future_salts#b921bd04 (6000607888526016552, 13) MTProto#1002#Scheduller:Adding package: #14 ping#7abe77ec (6000607888526016556, 15) MTProto#1002#Scheduller:Sending Package (6000607888526016560, 16) ActorDispatcher:Dispatching action: requestSalts for internal_actions MTProto#1003:Salt check timeout MTProto#1003:Too few actual salts: 0, requesting news ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 8 MTProto#1003#Scheduller:Iteration: count: 1, confirm:0 MTProto#1003#Scheduller:Building package MTProto#1003#Scheduller:Single package: #16 get_future_salts#b921bd04 (6000607888526016564, 13) ActorDispatcher:Dispatching action: requestSalts for internal_actions MTProto#1002:Salt check timeout MTProto#1002:Too few actual salts: 0, requesting news ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 8 MTProto#1002#Scheduller:Iteration: count: 1, confirm:0 MTProto#1002#Scheduller:Building package MTProto#1002#Scheduller:Single package: #17 get_future_salts#b921bd04 (6000607888526016568, 17) ActorDispatcher:Dispatching action: requestSalts for internal_actions MTProto#1001:Salt check timeout MTProto#1001:Too few actual salts: 0, requesting news ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 8 MTProto#1001#Scheduller:Iteration: count: 1, confirm:0 MTProto#1001#Scheduller:Building package MTProto#1001#Scheduller:Single package: #18 get_future_salts#b921bd04 (6000607888526016572, 15) ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller MTProto#1001#Transport5:Start reading message: pre MTProto#1001#Transport5:Start reading message: 88 TransportTcpPool#1001:onSuccess TransportTcpPool#1001:reset TransportRate:onConnectionSuccess #1 TransportRate:Transport: #1 173.240.5.1:443 #1.0 ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: bad_server_salt#edab447b MTProto#1001:BadMessage: 48 #6000607884231049264 MTProto#1001:Reschedule messages because bad_server_salt #6000607884231049264 MTProto#1001#Scheduller:Resending as new #15 ActorDispatcher:Dispatching action: requestSalts for internal_actions MTProto#1001:Salt check timeout MTProto#1001:Too few actual salts: 0, requesting news ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 8 MTProto#1001#Scheduller:Iteration: count: 1, confirm:0 MTProto#1001#Scheduller:Building package MTProto#1001#Scheduller:Single package: #19 get_future_salts#b921bd04 (6000607888526016576, 17) ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: ping#7abe77ec of size 12 Scheduller:Total size: 12 MTProto#1001#Scheduller:Iteration: count: 1, confirm:0 MTProto#1001#Scheduller:Building package MTProto#1001#Scheduller:Single package: #15 ping#7abe77ec (6000607888526016580, 19) ActorDispatcher:Dispatching action: schedule for scheduller MTProto#1003#Transport2:Start reading message: pre MTProto#1003#Transport2:Start reading message: 152 MTProto#1002#Transport3:Start reading message: pre ActorDispatcher:Dispatching action: new for response MTProto#1003#Transport2:Start reading message: pre MTProto#1002#Transport3:Start reading message: 184 MTProto#1003#Transport2:Start reading message: 1112 MTProto#1003:MTProtoMessage: new_session_created#9ec20908 TelegramApi#1001:mtproto#1003: onSessionCreated ActorDispatcher:Dispatching action: new for response MTProto#1001#Transport4:Start reading message: pre ActorDispatcher:Dispatching action: new for response MTProto#1003:MTProtoMessage: pong#347773c5 MTProto#1003:pong: 8266015509962921824 MTProto#1002:MTProtoMessage: new_session_created#9ec20908 MTProto#1003#Scheduller:Forgetting message: #6 TelegramApi#1001:mtproto#1002: onSessionCreated ActorDispatcher:Dispatching action: new for response MTProto#1001#Transport4:Start reading message: 152 MTProto#1002#Transport3:Start reading message: pre MTProto#1002:MTProtoMessage: pong#347773c5 MTProto#1002:pong: -1004136667723179958 MTProto#1002#Scheduller:Forgetting message: #7 MTProto#1002#Transport3:Start reading message: 1112 ActorDispatcher:Dispatching action: new for response MTProto#1002:MTProtoMessage: msgs_ack#62d6b459 MTProto#1001#Transport4:Start reading message: pre MTProto#1002:msgs_ack: 6000607888526016536 ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response MTProto#1001#Transport4:Start reading message: 1112 MTProto#1003#Transport2:Start reading message: pre MTProto#1003#Transport2:Start reading message: 88 MTProto#1003:MTProtoMessage: future_salts#ae500895 MTProto#1003#Scheduller:Forgetting message: #8 MTProto#1001:MTProtoMessage: new_session_created#9ec20908 TelegramApi#1001:mtproto#1001: onSessionCreated ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: msgs_ack#62d6b459 TelegramApi#1001:<< #0 confirmed in 3187 ms MTProto#1001:msgs_ack: 6000607888526016532 MTProto#1003#Transport2:Start reading message: pre MTProto#1003#Transport2:Start reading message: 1112 ActorDispatcher:Dispatching action: new for response MTProto#1002#Transport3:Start reading message: pre MTProto#1003:MTProtoMessage: pong#347773c5 MTProto#1003:pong: 4478047087429321965 ActorDispatcher:Dispatching action: new for response MTProto#1002:MTProtoMessage: future_salts#ae500895 MTProto#1002#Scheduller:Forgetting message: #10 MTProto#1003#Scheduller:Forgetting message: #12 ActorDispatcher:Dispatching action: new for response MTProto#1002#Transport3:Start reading message: 88 MTProto#1001#Transport5:Start reading message: pre MTProto#1001#Transport5:Start reading message: 328 ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response MTProto#1001#Transport5:Start reading message: pre MTProto#1001#Transport5:Start reading message: 1112 MTProto#1001#Transport4:Start reading message: pre MTProto#1001#Transport4:Start reading message: 88 MTProto#1002#Transport3:Start reading message: pre MTProto#1002#Transport3:Start reading message: 104 MTProto#1001:MTProtoMessage: future_salts#ae500895 MTProto#1001#Scheduller:Forgetting message: #9 ActorDispatcher:Dispatching action: new for response MTProto#1002:MTProtoMessage: pong#347773c5 MTProto#1001:Ignoring messages #6000607889761017857 ActorDispatcher:Dispatching action: new for response MTProto#1003:MTProtoMessage: future_salts#ae500895 MTProto#1003#Scheduller:Forgetting message: #16 MTProto#1001#Transport5:Start reading message: pre MTProto#1001#Transport5:Start reading message: 88 MTProto#1002:pong: -3207722024628328379 MTProto#1002#Scheduller:Forgetting message: #14 MTProto#1001#Transport4:Start reading message: pre MTProto#1001:MTProtoMessage: rpc_result#f35c6d01 MTProto#1001:rpc_result: 6000607888526016532 MTProto#1001:rpc_result: 6000607888526016532 #2e54dd74 MTProto#1001#Transport4:Start reading message: 264 MTProto#1002#Transport3:Start reading message: pre MTProto#1002#Transport3:Start reading message: 1112 ActorDispatcher:Dispatching action: new for response MTProto#1002:MTProtoMessage: rpc_result#f35c6d01 MTProto#1002:rpc_result: 6000607888526016536 MTProto#1001#Transport4:Start reading message: pre MTProto#1001#Transport4:Start reading message: 1112 TelegramApi#1001:<< #0 deserialized config#2e54dd74 in 0 ms TelegramApi#1001:<< #0 config#2e54dd74 in 3203 ms MTProto#1001#Scheduller:Forgetting message: #11 ActorDispatcher:Dispatching action: new for response completed. Phone number for bot:MTProto#1002:Auth key invalidated MTProto#1001:MTProtoMessage: future_salts#ae500895 MTProto#1001#Scheduller:Forgetting message: #18 ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: pong#347773c5 MTProto#1001:pong: 1010305957934124337 MTProto#1001#Scheduller:Forgetting message: #13 ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: pong#347773c5 MTProto#1001:pong: -7927455670892566000 MTProto#1001#Scheduller:Forgetting message: #15 ActorDispatcher:Dispatching action: new for response MTProto#1001:Ignoring messages #6000607889772435457 ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: future_salts#ae500895 MTProto#1001#Scheduller:Forgetting message: #19 +34XXXXXXXXX Sending sms to phone +34XXXXXXXXX...TelegramApi#1001:Timeout Iteration TelegramApi#1001:Sender iteration TelegramApi#1001:>> #1: auth.sendCode#768d5f4d ActorDispatcher:Dispatching action: schedule for scheduller MTProto#1001:sendMessage #20 auth.sendCode#768d5f4d TelegramApi#1001:#> #1 sent to MTProto #1001 with id #20 TelegramApi#1001:Sender iteration Scheduller:Prepare package: auth.sendCode#768d5f4d of size 72 Scheduller:Total size: 72 MTProto#1001#Scheduller:Iteration: count: 1, confirm:2 MTProto#1001#Scheduller:Building package MTProto#1001#Scheduller:Adding msg_ack: 2 MTProto#1001#Scheduller:Adding package: #20 auth.sendCode#768d5f4d (6000607888526016588, 21) MTProto#1001#Scheduller:Sending Package (6000607888526016592, 22) ActorDispatcher:Dispatching action: schedule for scheduller MTProto#1001#Transport4:Start reading message: pre MTProto#1001#Transport4:Start reading message: 88 ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: bad_server_salt#edab447b MTProto#1001:BadMessage: 48 #6000607888526016592 MTProto#1001:Reschedule messages because bad_server_salt #6000607888526016592 MTProto#1001#Scheduller:Resending as new #20 ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: auth.sendCode#768d5f4d of size 72 Scheduller:Total size: 72 MTProto#1001#Scheduller:Iteration: count: 1, confirm:0 MTProto#1001#Scheduller:Building package MTProto#1001#Scheduller:Single package: #20 auth.sendCode#768d5f4d (6000607914295820288, 23) ActorDispatcher:Dispatching action: requestSalts for internal_actions MTProto#1001:Salt check timeout MTProto#1001:Too few actual salts: 0, requesting news ActorDispatcher:Dispatching action: schedule for scheduller Scheduller:Prepare package: get_future_salts#b921bd04 of size 8 Scheduller:Total size: 8 MTProto#1001#Scheduller:Iteration: count: 1, confirm:0 MTProto#1001#Scheduller:Building package MTProto#1001#Scheduller:Single package: #21 get_future_salts#b921bd04 (6000607914295820292, 25) ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller MTProto#1001#Transport4:Start reading message: pre MTProto#1001#Transport4:Start reading message: 88 ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: msgs_ack#62d6b459 TelegramApi#1001:<< #1 confirmed in 344 ms MTProto#1001:msgs_ack: 6000607914295820288 MTProto#1001#Transport4:Start reading message: pre MTProto#1001#Transport4:Start reading message: 1112 ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: future_salts#ae500895 MTProto#1001#Scheduller:Forgetting message: #21 MTProto#1001#Transport4:Start reading message: pre MTProto#1001#Transport4:Start reading message: 104 ActorDispatcher:Dispatching action: new for response MTProto#1001:MTProtoMessage: rpc_result#f35c6d01 MTProto#1001:rpc_result: 6000607914295820288 TelegramApi#1001:<< #1 error #303 PHONE_MIGRATE_2 in 344 ms MTProto#1001#Scheduller:Forgetting message: #20 Exception in thread "main" java.lang.NullPointerException at org.telegram.actors.ActorSystem.close(ActorSystem.java:97) at org.telegram.mtproto.MTProto.close(MTProto.java:219) at org.telegram.api.engine.TelegramApi.switchToDc(TelegramApi.java:161) at org.telegram.bot.Application.login(Application.java:401) at org.telegram.bot.Application.main(Application.java:40)

The connection occurs but when you receive the error '303 'and trying to make switchDC, the error is displayed.

I use Java 1.7 and telegram-api-1.1.127-shadow.jar

I also try with all api source code and tl-api-v12.jar

Our goal is to make an application server for automatic sending of notifications to our workers

Thanks in advance.

dmasoft commented 10 years ago

Hola, Como bien indicas el error aparece cuando intentas cambiar de DC debido a que el tlfo que usas se registró en otro DC. Comprueba que la lista DC está completa para que la función switchDC este recibiendo correctamente los datos del nuevo DC. Lo más sencillo sería registrar directamente un nuevo número de tlfo para no tener que cambiar de DC.

Semro007 commented 10 years ago

Hola dmasoft,

he comprobado la lista de DC y la llena correctamente, haciendo pruebas he comentado las siguiente linea de la clase TelegramApi.java, en el método switchToDc:

    if (this.mainPushProto != null) {
        //this.mainPushProto.close();
    }

es justo en esa linea, al intentar cerrar cuando da el error.

Con ésto, el programa me envía correctamente al nº de teléfono que introduzco el código de activación, y al ponerlo en el programa lo reconoce como código válido, y ahí me he quedado, ahora voy a intentar enviar mensajes a cualquier otro número ...

Gracias Sergio

paketecuento commented 10 years ago

Hi,

We also have this problem in our code. No way to get the SMS. Commenting this line (as suggested by @Semro007 ) did not help:

    if (this.mainPushProto != null) {
        //this.mainPushProto.close();
    }

Any idea why it's not working??

regards,

RutgerRauws commented 10 years ago

Having the same error:

ActorDispatcher:Dispatching action: new for response
ActorDispatcher:Dispatching action: new for response
ActorDispatcher:Dispatching action: new for response
completed.
Phone number for bot:ActorDispatcher:Dispatching action: new for response
ActorDispatcher:Dispatching action: new for response
+316xxxxxxxx
Sending sms to phone +316xxxxxxxx...ActorDispatcher:Dispatching action: schedule for scheduller
ActorDispatcher:Dispatching action: schedule for scheduller
ActorDispatcher:Dispatching action: new for response
ActorDispatcher:Dispatching action: schedule for scheduller
ActorDispatcher:Dispatching action: requestSalts for internal_actions
ActorDispatcher:Dispatching action: schedule for scheduller
ActorDispatcher:Dispatching action: requestSalts for internal_actions
ActorDispatcher:Dispatching action: schedule for scheduller
ActorDispatcher:Dispatching action: new for response
ActorDispatcher:Dispatching action: new for response
ActorDispatcher:Dispatching action: new for response
Exception in thread "main" java.lang.NullPointerException
    at org.telegram.actors.ActorSystem.close(ActorSystem.java:97)
    at org.telegram.mtproto.MTProto.close(MTProto.java:221)
    at org.telegram.api.engine.TelegramApi.switchToDc(TelegramApi.java:161)
    at viopolice.Application.login(Application.java:401)
    at viopolice.Application.main(Application.java:40)
ActorDispatcher:Dispatching action: check for connector
ActorDispatcher:Dispatching action: schedule for scheduller
BUILD STOPPED (total time: 18 seconds)

Could we please speak English in stead of Spanish? Thanks in advance!

paketecuento commented 10 years ago

any update on this? is this project alive??

jmoral commented 10 years ago

Same error. If I use a test user in DC1 (79996612222), I get no error. Otherwise I get the same error

sebasao commented 10 years ago

Hi,

I'm getting same Null Pointer error, either using test or production servers. The exception is thrown right after entering the phone number

Any planned fix for this? Thanks

Log is:

Use test DC? (write test for test servers): test Using test servers Loading fresh DC list...ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: pingDelay for internal_actions ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: pingDelay for internal_actions ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: pingDelay for internal_actions ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response completed. Phone number for bot:ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response Sending sms to phone +447455XXXXXX...ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: requestSalts for internal_actions ActorDispatcher:Dispatching action: schedule for scheduller ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response ActorDispatcher:Dispatching action: new for response Exception in thread "main" java.lang.NullPointerException at org.telegram.actors.ActorSystem.close(ActorSystem.java:97) at org.telegram.mtproto.MTProto.close(MTProto.java:221) at org.telegram.api.engine.TelegramApi.switchToDc(TelegramApi.java:161) at org.telegram.bot.Application.login(Application.java:403) at org.telegram.bot.Application.main(Application.java:40) ActorDispatcher:Dispatching action: check for connector ActorDispatcher:Dispatching action: schedule for scheduller

coreGreenberet commented 10 years ago

Same Problem here =(

ghamary commented 10 years ago

And Me Too :(

tvdstaaij commented 10 years ago

This is a worrying issue -- this code is supposed to be a bare bones usage example of the Java reference API implementation, but it just doesn't work. And if even the code written by an insider is broken how are we supposed to use the reference API implementation ourselves?

Can the author comment on this?

cancerian0684 commented 9 years ago

I am facing the same issue -

Exception in thread "main" java.lang.NullPointerException
at org.telegram.actors.ActorSystem.close(ActorSystem.java:97)
at org.telegram.mtproto.MTProto.close(MTProto.java:221)
at org.telegram.api.engine.TelegramApi.switchToDc(TelegramApi.java:161)
at org.telegram.bot.Application.login(Application.java:401)
at org.telegram.bot.Application.main(Application.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

Any help from the Author ?

ashokcoolguys commented 9 years ago

AnyBody got this issue fixed???

romanesko commented 9 years ago

+1

thuvh commented 9 years ago

I'm facing same problem while using telegram-bot, how to solve this problem?

cancerian0684 commented 9 years ago

Somehow it works for me. I had activated telegram in my android mobile first then I used the phone number to activate this bot. here is my code -

private void login() throws IOException {
    Scanner scanner = new Scanner(System.in);
    System.out.print("Loading fresh DC list...");
    api.switchToDc(1);
    TLConfig config = api.doRpcCallNonAuth(new TLRequestHelpGetConfig());
    apiState.updateSettings(config);
    System.out.println("completed.");
    if (!apiState.isAuthenticated(5)) {
        System.out.print("Phone number for bot : ");
        String phone = scanner.nextLine();
        System.out.print("Sending sms to phone " + phone + "...");
        TLSentCode sentCode;
        try {
            sentCode = api.doRpcCallNonAuth(new TLRequestAuthSendCode(phone, 0, 5, "1c5c96d5edd401b1ed40db3fb5633e2d", "en"));
        } catch (RpcException e) {
            if (e.getErrorCode() == 303) {
                int destDC;
                if (e.getErrorTag().startsWith("NETWORK_MIGRATE_")) {
                    destDC = Integer.parseInt(e.getErrorTag().substring("NETWORK_MIGRATE_".length()));
                } else if (e.getErrorTag().startsWith("PHONE_MIGRATE_")) {
                    destDC = Integer.parseInt(e.getErrorTag().substring("PHONE_MIGRATE_".length()));
                } else if (e.getErrorTag().startsWith("USER_MIGRATE_")) {
                    destDC = Integer.parseInt(e.getErrorTag().substring("USER_MIGRATE_".length()));
                } else {
                    throw e;
                }
                api.switchToDc(destDC);
                sentCode = api.doRpcCallNonAuth(new TLRequestAuthSendCode(phone, 0, 5, "1c5c96d5edd401b1ed40db3fb5633e2d", "en"));
            } else {
                throw e;
            }
        }
        System.out.println("sent.");
        System.out.print("Activation code:");
        String code = scanner.nextLine();
        System.out.println(sentCode.getPhoneCodeHash());
        System.out.println(code);
        activateBot(phone, sentCode, code);
    }
    api.switchToDc(5);
    System.out.print("Loading Initial State...");
    TLState state = api.doRpcCall(new TLRequestUpdatesGetState());
    System.out.println("loaded.");
     }

private void activateBot(String phone, TLSentCode sentCode, String code) throws IOException {
    TLAuthorization auth = api.doRpcCallNonAuth(new TLRequestAuthSignIn(phone, sentCode.getPhoneCodeHash(), code));
    apiState.setAuthenticated(apiState.getPrimaryDc(), true);
    System.out.println("Activation Complete.");
}
victorlaerte commented 9 years ago

Still not working for me. Any suggestions?

cancerian0684 commented 9 years ago

Just changing the server ip address worked for me. What error you are getting ?

regards, Munish (मुनीश) On Jul 27, 2015 6:25 AM, "victorlaerte" notifications@github.com wrote:

Still not working for me

— Reply to this email directly or view it on GitHub https://github.com/ex3ndr/telegram-bot/issues/4#issuecomment-125053544.

victorlaerte commented 9 years ago

which ip are you using?? I'm using the ip provided by telegram with my app_id and app_hash.

new ConnectionInfo(1, 0, isTest ? "149.154.167.40" : "149.154.167.50", 443)

The error is a NPE when it trys to switch DC

api.switchToDc(destDC);
cancerian0684 commented 9 years ago

did you try this one ?

new ConnectionInfo(1, 0, isTest ? "149.154.175.10" : "149.154.175.50", 443)

It is still working for me without any NPE.

On Mon, Jul 27, 2015 at 8:13 PM, victorlaerte notifications@github.com wrote:

which ip are you using?? I'm using the ip provided by telegram with my app_id and app_hash.

new ConnectionInfo(1, 0, isTest ? "149.154.167.40" : "149.154.167.50", 443)

The error is a NPE when it trys to switch DC

api.switchToDc(destDC);

— Reply to this email directly or view it on GitHub https://github.com/ex3ndr/telegram-bot/issues/4#issuecomment-125230022.

regards, Munish Chandel

cancerian0684 commented 9 years ago

Earlier i also started getting NPE with the old IP addresses. Its bad on telegram part that they did not acknowledge about the IP address change.

On Mon, Jul 27, 2015 at 9:46 PM, Munish Chandel cancerian0684@gmail.com wrote:

did you try this one ?

new ConnectionInfo(1, 0, isTest ? "149.154.175.10" : "149.154.175.50", 443)

It is still working for me without any NPE.

On Mon, Jul 27, 2015 at 8:13 PM, victorlaerte notifications@github.com wrote:

which ip are you using?? I'm using the ip provided by telegram with my app_id and app_hash.

new ConnectionInfo(1, 0, isTest ? "149.154.167.40" : "149.154.167.50", 443)

The error is a NPE when it trys to switch DC

api.switchToDc(destDC);

— Reply to this email directly or view it on GitHub https://github.com/ex3ndr/telegram-bot/issues/4#issuecomment-125230022.

regards, Munish Chandel

regards, Munish Chandel

simaRanjbar commented 9 years ago

I had this problem too.I change IP address of server and I get Activation code.this link can help you.there is diffrent IP addresses in this page that you can use. https://github.com/telegramdesktop/tdesktop/blob/master/Telegram/SourceFiles/config.h#L108

hamidpp commented 9 years ago

Where should I use when I took the public key from telegram when login?

vaibhavthapliyal commented 8 years ago

Using this ip as the production ip works for me: "149.154.171.5"