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

write_auth_file: Assertion `auth_file_fd >= 0' failed #536

Closed
gnumoksha opened this issue May 19, 2015 · 6 comments
Closed

write_auth_file: Assertion `auth_file_fd >= 0' failed #536

gnumoksha opened this issue May 19, 2015 · 6 comments

Comments

@gnumoksha
Copy link

root@debian8:/usr/src/tg/zabbix# ./telegram-cli -k tg-server.pub -c telegram.config
Telegram-cli version 1.3.1, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
Telegram-cli uses libtgl version 2.0.1
phone number: +551122223333
code ('call' for phone call): 33594
> telegram-cli: loop.c:361: write_auth_file: Assertion `auth_file_fd >= 0' failed.
SIGNAL received
h./telegram-cli(print_backtrace+0x20)[0x4686e0]
./telegram-cli(termination_signal_handler+0x64)[0x468764]
/lib/x86_64-linux-gnu/libc.so.6(+0x35180)[0x7f48428db180]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f48428db107]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f48428dc4e8]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e226)[0x7f48428d4226]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e2d2)[0x7f48428d42d2]
./telegram-cli(write_auth_file+0x102)[0x4699f2]
./telegram-cli(tgl_export_auth_callback+0x66)[0x48f7b6]
./telegram-cli[0x4835ee]
./telegram-cli(tglq_query_result+0x10f)[0x48914f]
./telegram-cli[0x4824de]
./telegram-cli[0x4a1e8b]
/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x7fc)[0x7f48442713dc]
./telegram-cli(net_loop+0xa4)[0x4697c4]
./telegram-cli(loop+0x17f)[0x46aa6f]
./telegram-cli(main+0x282)[0x4670a2]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f48428c7b45]
./telegram-cli[0x467188]
root@debian8:/usr/src/tg/zabbix#

telegram.config

default_profile = "zabbix";

zabbix = {
    config_directory = "/usr/src/tg/zabbix/";
    #test = false;
    #msg_num = true;
    #binlog_enabled = true;
    #log_level = 2;
};

ls /usr/src/tg/zabbix/

root@debian8:/usr/src/tg/zabbix# ls /usr/src/tg/zabbix/
telegram-cli  telegram.config  tg-server.pub

Directories don't are created. Is config file structure changed?

@gnumoksha
Copy link
Author

This occurred in debian 8, jessie with version 1.3.1. With the version 1.2 its works

In ubuntu 14.04.2 is fine with both versions.

@vysheng
Copy link
Owner

vysheng commented May 20, 2015

you should create directories manually. Telegram-cli doesn't create them

@gnumoksha
Copy link
Author

Hi @vysheng, thanks for replying.

I executed the same process in both enviroments, debian 8 and ubuntu 14.04.2. Many times. Only in debian 8 i get this error. The directory is created in ubuntu.

Creating the directory:

root@debian8:/usr/src/tg/viacron# mkdir downloads
root@debian8:/usr/src/tg/viacron# ./telegram-cli -k tg-server.pub -c telegram.config
Telegram-cli version 1.3.1, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
Telegram-cli uses libtgl version 2.0.1
phone number: +551122223333
code ('call' for phone call): 85502
> telegram-cli: loop.c:361: write_auth_file: Assertion `auth_file_fd >= 0' failed.
SIGNAL received
h./telegram-cli(print_backtrace+0x20)[0x4686e0]
./telegram-cli(termination_signal_handler+0x64)[0x468764]
/lib/x86_64-linux-gnu/libc.so.6(+0x35180)[0x7f7a03850180]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f7a03850107]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f7a038514e8]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e226)[0x7f7a03849226]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e2d2)[0x7f7a038492d2]
./telegram-cli(write_auth_file+0x102)[0x4699f2]
./telegram-cli(tgl_export_auth_callback+0x66)[0x48f7b6]
./telegram-cli[0x4835ee]
./telegram-cli(tglq_query_result+0x10f)[0x48914f]
./telegram-cli[0x4824de]
./telegram-cli[0x4a1e8b]
/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x7fc)[0x7f7a051e63dc]
./telegram-cli(net_loop+0xa4)[0x4697c4]
./telegram-cli(loop+0x17f)[0x46aa6f]
./telegram-cli(main+0x282)[0x4670a2]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f7a0383cb45]
./telegram-cli[0x467188]
root@debian8:/usr/src/tg/viacron# ls
downloads  telegram-cli  telegram.config  tg-server.pub

Creating the rest of files:

root@debian8:/usr/src/tg/viacron# touch auth secret state
root@debian8:/usr/src/tg/viacron# ./telegram-cli -k tg-server.pub -c telegram.config
Telegram-cli version 1.3.1, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
Telegram-cli uses libtgl version 2.0.1
phone number: +551122223333
code ('call' for phone call): 48697
> telegram-cli: loop.c:361: write_auth_file: Assertion `auth_file_fd >= 0' failed.
SIGNAL received
h./telegram-cli(print_backtrace+0x20)[0x4686e0]
./telegram-cli(termination_signal_handler+0x64)[0x468764]
/lib/x86_64-linux-gnu/libc.so.6(+0x35180)[0x7f81dd796180]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f81dd796107]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f81dd7974e8]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e226)[0x7f81dd78f226]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e2d2)[0x7f81dd78f2d2]
./telegram-cli(write_auth_file+0x102)[0x4699f2]
./telegram-cli(tgl_export_auth_callback+0x66)[0x48f7b6]
./telegram-cli[0x4835ee]
./telegram-cli(tglq_query_result+0x10f)[0x48914f]
./telegram-cli[0x4824de]
./telegram-cli[0x4a1e8b]
/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x7fc)[0x7f81df12c3dc]
./telegram-cli(net_loop+0xa4)[0x4697c4]
./telegram-cli(loop+0x17f)[0x46aa6f]
./telegram-cli(main+0x282)[0x4670a2]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f81dd782b45]
./telegram-cli[0x467188]
root@debian8:/usr/src/tg/viacron#

Perhaps is a lib error?

@vysheng
Copy link
Owner

vysheng commented May 20, 2015

no, it is not related to library. It is clearly error opening auth_file. Try to add -U root key. Check that folder from config exists

@gnumoksha
Copy link
Author

root@debian8:/usr/src/tg/viacron# cat telegram.config 
default_profile = "viacron";

viacron = {
    config_directory = "/usr/src/tg/viacron/";
};
root@debian8:/usr/src/tg/viacron# ./telegram-cli -k tg-server.pub -c telegram.config -U root
Telegram-cli version 1.3.1, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
Telegram-cli uses libtgl version 2.0.1
[/usr/src/tg/viacron//downloads] created
phone number: +551122223333
code ('call' for phone call): 54442
> contact_list
[my contacts here]
> safe_quit
> quit

The problem is that the user telegramd existed in the system. I suppose that telegram-cli was changing to him.

Thanks for help, @vysheng

@mohammadfalahat
Copy link

which directories we have to make in centOs? pls list them. I am newbie to linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants