MadelineProto icon indicating copy to clipboard operation
MadelineProto copied to clipboard

Failed to Start testing.php

Open toriqahmads opened this issue 8 years ago • 3 comments

Hello dev,

I'm failed to start testing.php. I use the latest version, install phyton, using php7 and run in vps. But I still can't run the testing.php

`php testing.php Deserializing MadelineProto from session.madeline... string(19) "File does not exist" Loading .env... Loading settings... string(71) "{"app_info":{"api_id":6,"api_hash":"eb06d4abfb49dc3eeb1aeb98ae0f581e"}}" array(1) { ["app_info"]=> array(2) { ["api_id"]=> int(6) ["api_hash"]=> string(32) "eb06d4abfb49dc3eeb1aeb98ae0f581e" } } Loading MadelineProto... TL: Loading TL schemes... TL: Parsing TL_mtproto_v1.json... TL: Parsing TL_telegram_v73.tl... TL: Parsing TL_secret.tl... TL: Parsing TL_calls.tl... TL: CRC32 mismatch (e8201c08, dbf948c1) for decryptedDataBlock#dbf948c1 random_id:long random_bytes:string flags:# voice_call_id:flags.2?int128 in_seq_no:flags.4?int out_seq_no:flags.4?int recent_received_mask:flags.5?int proto:flags.3?int extra:flags.1?string raw_data:flags.0?string = DecryptedDataBlock; TL: CRC32 mismatch (d20a6f5c, cc0d0e76) for simpleDataBlock#cc0d0e76 random_id:long random_bytes:string raw_data:string = DecryptedDataBlock; TL: Parsing TL_botAPI.tl... DataCenter: Connecting to DC 2 (main server, ipv4, tcp_full)... DataCenter: OK! MTProto: Generating permanent authorization key for DC 2... AuthKeyHandler: Requesting pq... ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorization 3468098370199928039 = 1759848407 * 1970680177 RSA: Encrypting with rsa key... AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s AuthKeyHandler: Executing p/g checks (1/2)... AuthKeyHandler: Executing p/g checks (2/2)... AuthKeyHandler: Executing g check... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated MTProto: Generating temporary authorization key for DC 2... AuthKeyHandler: Requesting pq... ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorization 1186802013214643047 = 1056996323 * 1122806189 RSA: Encrypting with rsa key... AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s AuthKeyHandler: Executing p/g checks (1/2)... AuthKeyHandler: Executing p/g checks (2/2)... AuthKeyHandler: Executing g check... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated AuthKeyHandler: Binding authorization keys... MsgIdHandler: WARNING: Given message id (6517257952815304705) is bigger than or equal to the current limit (6517257952815248385). Consider syncing your date. AuthKeyHandler: Successfully binded temporary and permanent authorization keys, DC 2 MTProto: Writing client info (also executing help.getConfig)... MTProto: Got new DC options, reconnecting DataCenter: Disconnecting from DC 2... DataCenter: Connecting to DC 2 (main server, ipv4, tcp_full)... DataCenter: OK! DataCenter: Connecting to DC 1 (main server, ipv4, tcp_full)... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 443... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 80... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 88... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 443 without the proxy... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 80 without the proxy... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 88 without the proxy... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connecting to DC 3 (main server, ipv4, tcp_full)... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 443... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 80... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 88... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 443 without the proxy... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 80 without the proxy... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connection failed, retrying connection on port 88 without the proxy... Exception: Connection: couldn't connect to socket. in Connection.php:109 DataCenter: Connecting to DC 4 (main server, ipv4, tcp_full)... DataCenter: OK! DataCenter: Connecting to DC 4_media (main server, ipv4, tcp_full)... DataCenter: OK! DataCenter: Connecting to DC 5 (main server, ipv4, tcp_full)... DataCenter: OK! MTProto: Generating permanent authorization key for DC 4... AuthKeyHandler: Requesting pq... ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorization 1918760913608005471 = 1072953899 * 1788297629 RSA: Encrypting with rsa key... AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s AuthKeyHandler: Executing p/g checks (1/2)... AuthKeyHandler: Executing p/g checks (2/2)... AuthKeyHandler: Executing g check... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated MTProto: Generating temporary authorization key for DC 4... AuthKeyHandler: Requesting pq... ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorization 2144761086252617747 = 1256413453 * 1707050399 RSA: Encrypting with rsa key... AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = -1.0 s AuthKeyHandler: Executing p/g checks (1/2)... AuthKeyHandler: Executing p/g checks (2/2)... AuthKeyHandler: Executing g check... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated AuthKeyHandler: Binding authorization keys... MsgIdHandler: WARNING: Given message id (6517258092326190081) is bigger than or equal to the current limit (6517258092326145025). Consider syncing your date. AuthKeyHandler: Successfully binded temporary and permanent authorization keys, DC 4 MTProto: Writing client info (also executing help.getConfig)... MTProto: Generating permanent authorization key for DC 5... AuthKeyHandler: Requesting pq... ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorization 1610670023161658651 = 1207161247 * 1334262533 RSA: Encrypting with rsa key... AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s AuthKeyHandler: Executing p/g checks (1/2)... AuthKeyHandler: Executing p/g checks (2/2)... AuthKeyHandler: Executing g check... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated MTProto: Generating temporary authorization key for DC 5... AuthKeyHandler: Requesting pq... ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorization 1806135379428170149 = 1026315671 * 1759824419 RSA: Encrypting with rsa key... AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s AuthKeyHandler: Executing p/g checks (1/2)... AuthKeyHandler: Executing p/g checks (2/2)... AuthKeyHandler: Executing g check... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... AuthKeyHandler: Executing g_a check (1/2)... AuthKeyHandler: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated AuthKeyHandler: Binding authorization keys... MsgIdHandler: WARNING: Given message id (6517258099650623489) is bigger than or equal to the current limit (6517258099650571265). Consider syncing your date. AuthKeyHandler: Successfully binded temporary and permanent authorization keys, DC 5 MTProto: Writing client info (also executing help.getConfig)... MTProto: Updated config! MTProto: { "_": "config", "phonecalls_enabled": false, "default_p2p_contacts": false, "date": 1517417364, "expires": 1517421025, "test_mode": false, "this_dc": 2, "chat_size_max": 200, "megagroup_size_max": 100000, "forwarded_count_max": 100, "online_update_period_ms": 120000, "offline_blur_timeout_ms": 5000, "offline_idle_timeout_ms": 30000, "online_cloud_timeout_ms": 300000, "notify_cloud_delay_ms": 30000, "notify_default_delay_ms": 1500, "chat_big_size": 10, "push_chat_period_ms": 60000, "push_chat_limit": 2, "saved_gifs_limit": 200, "edit_time_limit": 172800, "rating_e_decay": 2419200, "stickers_recent_limit": 30, "stickers_faved_limit": 5, "channels_read_media_period": 604800, "pinned_dialogs_count_max": 5, "call_receive_timeout_ms": 20000, "call_ring_timeout_ms": 90000, "call_connect_timeout_ms": 30000, "call_packet_timeout_ms": 10000, "me_url_prefix": "https://t.me/", "disabled_features": [] } MTProto: We're in US, current DC is 2, nearest DC is 3. API: Running APIFactory... Exception: Undefined offset: 3 in MsgIdHandler.php:77 CallHandler: An error occurred while calling method ping: Undefined offset: 3 in MsgIdHandler on line 77. Recreating connection and retrying to call method... Exception: Undefined offset: 3 in MTProto.php:641 \danog\MadelineProto\Exception: Undefined offset: 3 in /home/ubuntu/workspace/MadelineProto/src/danog/MadelineProto/MTProto.php:641 TL Trace (YOU ABSOLUTELY MUST READ THE TEXT BELOW):

MTProto.php(641): ExceptionErrorHandler(8,"Undefined offset: 3","/home/ubuntu/workspace/MadelineProto/src/danog/MadelineProto/MTProto.php",641,{"datacenter":3}) CallHandler.php(206): close_and_reopen(3) APIFactory.php(133): method_call("ping",{"ping_id":"\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},{"datacenter":3}) API.php(82): __call("ping",[{"ping_id":3}]) Serializable.php(35): ___construct({"app_info":{"api_id":6,"api_hash":"eb06d4abfb49dc3eeb1aeb98ae0f581e"}}) testing.php(62): __construct({"app_info":{"api_id":6,"api_hash":"eb06d4abfb49dc3eeb1aeb98ae0f581e"}})

` I alaways got this response. I've trying to search in the issue, but still stuck. Please help me.

Thank you

toriqahmads avatar Jan 31 '18 16:01 toriqahmads

Datacenter 1 was having issues, when this stuff happens, you just gotta wait.

danog avatar Feb 05 '18 08:02 danog

In the second login I receive this error: Consider syncing your date. AuthKeyHandler: Successfully binded temporary and permanent authorization keys, DC 5 CallHandler: Writing client info (also executing help.getConfig)... MTProto: We're in DE, nearest DC is 2. API: Running APIFactory... API: MadelineProto is ready! API: Waiting for shared lock of serialization lockfile... API: Shared lock acquired, deserializing... DataCenter, 528616330: Disconnecting from DC 2... DataCenter, 528616330: Disconnecting from DC 1... DataCenter, 528616330: Disconnecting from DC 3... DataCenter, 528616330: Disconnecting from DC 4... DataCenter, 528616330: Disconnecting from DC 5... DataCenter, 528616330: Connecting to DC 2 (main server, ipv6, tcp_abridged)... DataCenter, 528616330: Trying connection on port 443... DataCenter, 528616330: OK! DataCenter, 528616330: Connecting to DC 1 (main server, ipv6, tcp_abridged)... DataCenter, 528616330: Trying connection on port 443... DataCenter, 528616330: OK! DataCenter, 528616330: Connecting to DC 3 (main server, ipv6, tcp_abridged)... DataCenter, 528616330: Trying connection on port 443... DataCenter, 528616330: OK! DataCenter, 528616330: Connecting to DC 4 (main server, ipv6, tcp_abridged)... DataCenter, 528616330: Trying connection on port 443... DataCenter, 528616330: OK! DataCenter, 528616330: Connecting to DC 5 (main server, ipv6, tcp_abridged)... DataCenter, 528616330: Trying connection on port 443... DataCenter, 528616330: OK! UpdateHandler, 528616330: Not fetching normal difference, I am already fetching it MsgIdHandler, 528616330: WARNING: Given message id (6532940255162557441) is bigger than or equal to the current limit (6532940255162518529). Consider syncing your date. MTProto, 528616330: Getting updates after deserialization... API, 528616330: Serializing MadelineProto... Serialization, 528616330: Waiting for exclusive lock of serialization lockfile... Serialization, 528616330: Lock acquired, serializing API, 528616330: Serializing MadelineProto... Serialization, 528616330: Waiting for exclusive lock of serialization lockfile... Serialization, 528616330: Lock acquired, serializing

Waiting for exclusive lock of serialization lockfile

$settings = [
	'logger' => ['logger' => 3],
	'app_info' => [
        'api_id'          => 7,
        'api_hash'        => 'tytyk'
	],
    'flood_timeout' => [
        'wait_if_lt' => 90000
    ],
    'serialization' => [
        'serialization_interval' => 10,
    ]
		];
		
$MadelineProto = new \danog\MadelineProto\API($settings);
$sessionf = __DIR__ . "/tmp/sess_".str_replace('+', '', $phone);

if(!file_exists($sessionf)) {
	$r_info = $MadelineProto->phone_login($phone);
	$phone_code_hash = $r_info['phone_code_hash'];
	if(1 === 2) $MadelineProto->auth->resendCode(['phone_number' => $phone, 'phone_code_hash' => $phone_code_hash ]);
	if($phone_code_hash) {
		\danog\MadelineProto\Serialization::serialize($sessionf, $MadelineProto);
	}
}
elseif (empty($code) === false) {
	$MadelineProto = \danog\MadelineProto\Serialization::deserialize($sessionf);
	$r_info = $MadelineProto->phone_login($phone);
	$authorization = $MadelineProto->complete_phone_login($code);
if ($authorization['_'] === 'account.password') {
    $authorization = $MadelineProto->complete_2fa_login('******');
}

	$MadelineProto->session = $sessionf;
	$MadelineProto->serialize();
}
else {
	$MadelineProto = new \danog\MadelineProto\API($sessionf);
	$offset = 0;
while (true) {
    $updates = $MadelineProto->API->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]);
	
    foreach ($updates as $update) {
// some codes
 }
	echo '.';
	$MadelineProto = new \danog\MadelineProto\API($sessionf, $settings);
}
}

What is the problem ?

sallsabil avatar Mar 14 '18 23:03 sallsabil

This looks fine, everything should work.

danog avatar Mar 16 '18 11:03 danog