telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.41k stars 5.25k forks source link

Telegram desktop asks about access code every time I start Telegram application #960

Closed mareg closed 7 years ago

mareg commented 9 years ago

OS: Fedora 22 64bit

Every day I come from work and I start telegram on my desktop - it asks to give my phone number and requests the access code. It forgets notification settings as well. As if it didn't save the data on disk.

On my work laptop it remembers settings between sessions. No idea why it happens, I run Fedora 22 64bit on my work laptop too.

fjfalcon commented 9 years ago

Got same issue, archlinux 64, telegram-desktop installed from aur. Strange fact, issue starts when i get tdesktop updated.

telegramdesktop commented 9 years ago

installed from aur? what if you try binary from tdesktop.com?

looks like it can't write on disk, yes.. it tries to write to ~/.TelegramDesktop, could it be write protected from him?

fjfalcon commented 9 years ago

So, after i installed binary from tdesktop.com telegram asked about access code only once. And all works as it should. Before that i checked acl with find ./TelegramDesktop -type f -exec ls -l {} \; and all files and have my local user as owner. That quite strange...

telegramdesktop commented 9 years ago

I'm not sure then, what build have you used before, I know only about the binary build from tdesktop.com, which I test in several Linux distros, that it should work and save all its files in home dir in ".TelegramDesktop" hidden folder.

Does topic starter use binary from official site or some other installation? @mareg

mareg commented 9 years ago

For me - sometimes it survives the restart, other times it doesn't. but it happens only on one computer, on the other computer it works just fine. there's no pattern.

@telegramdesktop I am using rommon-telegram repository hosted on fedoradesktop.org - repositories are standard ways of managing updates on linux platform, I do not install builds downloaded off the web, I only install applications if they provide repo for their packages.

I can tell that Telegram uses some kind of auto-update mechanism - this is not how it should be done on linux, because I don't have control which version I am running. Yes I do install updates (my OS checks for them daily).

And yes, .TelegramDesktop is writable:

$ ll -a | grep Telegram
drwxrwxr-x    4 marek marek       78 Aug  6 10:58 .TelegramDesktop
aquada commented 9 years ago

Mine is installed in /opt and gets updates through the app. Same problem started a few days ago. I'm on Mint 17.2 (Ubuntu 14.04 base). The directory is writeable for the user.

mareg commented 9 years ago

@alleyoopster The new update is being downloaded and installed into ~/.TelegramDesktop which may be OK on Windows platform, but is desired on Linux platform.

mareg commented 9 years ago

@telegramdesktop having to enter the code every time I start Telegram is really annoying.

aquada commented 9 years ago

@mareg It is working for me again now. maybe since the last update. I don't think it matters where it is installed as long as the directory is writeable for the app.

mareg commented 9 years ago

@alleyoopster it's on and off for me - usually when the update arrives, it "forgets" settings. Also I have two entries in the menu now "Telegram" and "Telegram Desktop"... one pointing to the version installed through package manager, other pointing to the latest version installed via updater in my user's directory. Hope this PR https://github.com/telegramdesktop/tdesktop/pull/920 will solve the auto updater issue.

auchri commented 9 years ago

1020 (#920) was just merged :)

telegramdesktop commented 9 years ago

Well, new builds for repositories now can disable auto-update from tdesktop.com by a macro, I'm afraid I won't fix anything else for them, cause I test only builds that are available at https://desktop.telegram.org for download.

fjfalcon commented 9 years ago

Ok, i ask you to reopen this bug.

Telegram version from desktop.telegram.org. Bugs: Session dropped, i almost always need to enter code from my mobile phone. This especialy encounters when i recieve new update, cause i recieve it multiple times for same version. Dunno why. Telegram directory fully writable, i especialy do 777 for testing purprose.

OS: ArchLinux Telegram version: 0.9.2

My chat with service notifications... It's really annoying. If there any more options i can provide to help you fix this annoying bug - please, tell me. 2015-09-27_566x1062

aquada commented 9 years ago

@fjfalcon I feel your frustration. I had this for a while also. Have you tried uninstalling completely (check home hidden folders and /opt) and installing telegram bin from AUR. After this let Arch do the updates from AUR and turn off auto updates in the Telegram app. I am running like this and all is good.

Quarx2k commented 9 years ago

I had same on windows with 0.8.x 0.9.1, when telegram freezes and i kill process with Task Manager. After next start, app ask for phone number again and all settings cleared. On Ubuntu 15.04 too, sometimes, when i forgot correct exit from app before shutdown pc.

andlabs commented 9 years ago

This is happening for me on Ubuntu 15.04 with 0.9.2 as well. I'm tempted to file a separate issue for it.

telegramdesktop commented 9 years ago

@andlabs Telegram Desktop has all its data in ~/.TelegramDesktop folder, it should be available for write. What is in log.txt from that folder?

andlabs commented 9 years ago

@telegramdesktop The folder is mode 775; all the data seems to be there. Log file:

[2015.09.30 13:07:55] Audio init time: 48
[2015.09.30 13:07:56] TCP Error: network - Network unreachable
[2015.09.30 13:07:56] HTTP Error: network error 99 - Network unreachable
[2015.09.30 13:07:56] Not using Unity Launcher count.
[2015.09.30 13:07:57] TCP Error: network - Network unreachable
[2015.09.30 13:07:57] HTTP Error: network error 99 - Network unreachable
[2015.09.30 13:08:00] TCP Error: network - Network unreachable
[2015.09.30 13:08:00] HTTP Error: network error 99 - Network unreachable
[2015.09.30 13:08:01] TCP Error: network - Network unreachable
[2015.09.30 13:08:01] HTTP Error: network error 99 - Network unreachable
[2015.09.30 13:08:04] TCP Error: network - Network unreachable
[2015.09.30 13:08:04] HTTP Error: network error 99 - Network unreachable
[2015.09.30 13:08:05] TCP Error: network - Network unreachable
[2015.09.30 13:08:05] HTTP Error: network error 99 - Network unreachable
andlabs commented 9 years ago

I figured it out: I still had the 0.8 binary in my $PATH, and it was loading that and getting confused. I changed the $PATH entry to be a symlink to ~/.TelegramDesktop/Telegram and now everything works.

telegramdesktop commented 9 years ago

@andlabs There is no need to gold Telegram binary in ~/.TelegramDesktop, this folder is used for storing data and should be accessible for writing by Telegram binary, but the binary itself can be in any other place, like ~/Desktop/Telegram/ for example. In order for autoupdater to work it should be accessible for writing as well.

andlabs commented 9 years ago

All right, good to know. I'm not sure why the updater didn't overwrite my ~/bin/Telegram, so I'll have to look into this more sometime...

RomanHargrave commented 8 years ago

@telegramdesktop Nope, the updater did not appear to "update" the telegram binary at ~/.local/bin/Telegram.

TheBlackViper1996 commented 8 years ago

I'm having the same issue, this is what the log file says: [2015.12.14 02:01:35] RPC Error: request 14 got fail with code 400, error AUTH_BYTES_INVALID [2015.12.14 02:01:36] RPC Error: request 16 got fail with code 401, error AUTH_KEY_UNREGISTERED [2015.12.14 02:01:36] RPC Error: request 18 got fail with code 401, error AUTH_KEY_UNREGISTERED [2015.12.14 02:01:37] RPC Error: request 17 got fail with code 401, error AUTH_KEY_UNREGISTERED [2015.12.14 02:01:37] RPC Error: request 19 got fail with code 401, error AUTH_KEY_UNREGISTERED [2015.12.14 02:03:16] RPC Error: request 66 got fail with code 400, error AUTH_BYTES_INVALID [2015.12.14 02:03:16] RPC Error: request 69 got fail with code 401, error AUTH_KEY_UNREGISTERED [2015.12.14 02:03:17] RPC Error: request 70 got fail with code 401, error AUTH_KEY_UNREGISTERED [2015.12.14 02:03:17] RPC Error: request 68 got fail with code 401, error AUTH_KEY_UNREGISTERED [2015.12.14 02:03:17] RPC Error: request 71 got fail with code 401, error AUTH_KEY_UNREGISTERED

fjfalcon commented 8 years ago

Problem still not solved, btw. So, it's nice you reopen it.

linuxbandit commented 8 years ago

solved for me with the "hack" of @andlabs

cialu commented 8 years ago

Got same issue on Fedora 23 with Telegram Desktop 0.9.33 and log file shows this: [2016.03.20 06:38:48] Could not load 'appindicator3' with version 1 :( [2016.03.20 06:38:48] Could not load 'appindicator' with version 1 :( [2016.03.20 06:38:48] App Info: reading settings.. [2016.03.20 06:38:48] App Info: reading encrypted settings.. [2016.03.20 06:38:48] App Info: reading map.. [2016.03.20 06:38:48] App Info: reading encrypted map.. [2016.03.20 06:38:48] App Info: reading encrypted user settings.. [2016.03.20 06:38:48] App Info: reading encrypted mtp data.. [2016.03.20 06:38:48] Map read time: 0 [2016.03.20 06:38:48] Not using Unity Launcher count. [2016.03.20 06:38:48] TCP Error: network - Network unreachable [2016.03.20 06:38:48] HTTP Error: network error 99 - Network unreachable [2016.03.20 06:39:14] TCP Error: network - Network unreachable [2016.03.20 06:39:14] TCP Error: network - Network unreachable [2016.03.20 06:39:14] HTTP Error: network error 99 - Network unreachable [2016.03.20 06:43:59] Message Info: bad message notification received (error_code 16) for msg_id = 6264005057608610020, seq_no = 57 [2016.03.20 06:44:14] TCP Error: network - Network unreachable [2016.03.20 06:44:14] HTTP Error: network error 99 - Network unreachable

elbaulp commented 8 years ago

I still have the same problem. :-(

fjfalcon commented 8 years ago

As for me i have this workaround: I create link to ~/Telegram/telegram to /usr/bin/telegram so i can easy run in. When telegram ask for update i simple close him, going to telegram.org, downloading it, simple tar xvf tsetup...tar.xz and my ~/Telegram folder gets updated. As for you you can create .desktop file or any other pointer to run telegram from your favorite launcher. No more problem with update.

elbaulp commented 8 years ago

I have the bin in ~/bin/Telegram/ and in that folder I have the binary and the updater, before, I do not know why, in .TelegramDesktop/ I also have the updater and the binary, I just removed .TelegramDesktop and reinstall Telegram, hope this solve the problem.

On Sun, Mar 20, 2016 at 8:57 AM Pavel Chernyak notifications@github.com wrote:

As for me i have this workaround: I create link to ~/Telegram/telegram to /usr/bin/telegram so i can easy run in. When telegram ask for update i simple close him, going to telegram.org, downloading it, simple tar xvf tsetup...tar.xz and my ~/Telegram folder gets updated. As for you you can create .desktop file or any other pointer to run telegram from your favorite launcher. No more problem with update.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/960#issuecomment-198868769

Alejandro Alcalde - elbauldelprogramador.com

fjfalcon commented 8 years ago

Well, i simple don't use telegram autoupdate and update it manualy when client finds new version.

elbaulp commented 8 years ago

I solve it moving the telegram executable inside que folder. .Telegram, and then adding that directory to my path, no problems since then.

On Sat, Jun 11, 2016, 23:39 Pavel Chernyak notifications@github.com wrote:

Well, i simple don't use telegram autoupdate and update it manualy when client finds new version.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/960#issuecomment-225395974, or mute the thread https://github.com/notifications/unsubscribe/AAYGLZcw-3NO3G8tjp88LLOVHbC8mdR1ks5qKysbgaJpZM4FljkQ .

Alejandro Alcalde - elbauldelprogramador.com

sindrom91 commented 8 years ago

I can confirm that Telegram didn't update the actual binary I ran, but it did add the updated binary to ~/.TelegramDesktop.

sindrom91 commented 8 years ago

I created a symbolic link to Telegram binary in /usr/local/bin/ and that is what I use to run Telegram. When I run telegram like that, it doesn't update properly. But when I use the actual binary to run it, it updates properly. I also noticed that, when I ran it from symbolic link, Executable dir in log.txt was set to ~/.TelegramDesktop (that is not where the binary is located).

SharkWipf commented 8 years ago

Ran into this as well, until an official fix is created for this, the easiest workaround would probably be to create a symlink to the binary that does properly get updated, so doing something like: ln -fs ~/.TelegramDesktop/Telegram ~/bin/telegram (replace ~/bin/telegram with wherever you have your symlink, i.e. /usr/local/bin/telegram).

No moving of executables or whatever required otherwise, just a new symlink.

sindrom91 commented 8 years ago

I found another workaround that works for me. I created a script that runs Telegram, put it in /usr/local/bin and gave it execution permission. It seems to work well, but there has been just one update, and I didn't have any issues.

#!/bin/bash
cd /path/to/Telegram && ./Telegram
zelmor commented 8 years ago

For me the issue arises after update. My Telegram application is located in /opt/Telegram and a symlink is created for /bin/telegram

/opt is where this application should, in my opinion, store its binaries. Not under the home folder.

strasharo commented 8 years ago

Same here on Fedora 24. There are two shortcuts for the app. One is global and is located in /usr/share/applications/telegram-desktop.desktop

[Desktop Entry]
Name=Telegram
GenericName=Telegram Messenger
Exec=telegram
Terminal=false
Icon=telegram
Type=Application
Categories=Network;
X-Desktop-File-Install-Version=0.22

After the update the following shortcut gets created: /home/<user>/.local/share/applications/telegramdesktop.desktop

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
Exec=/home/<user>/.TelegramDesktop/Telegram -- %u
Icon=telegram
Terminal=false
StartupWMClass=Telegram
Type=Application
Categories=Network;
MimeType=x-scheme-handler/tg;
X-Desktop-File-Install-Version=0.23

And it points to the updated version located in the user's home directory. So we end up with two shortcuts in the menu - one wrong and one correct.

This causes the mismatch and the described behavior.

5chdn commented 8 years ago

Hell, this is an annoying issue. After reading this whole thread finally, I can only suggest to disable auto update on linux systems by default. In opposite to systems like osx or windows, you usually get updates of the software from the repositories. Please consider this, it can't be expected of all linux users to disable it manually or hack the $PATH.

An alternative would be to allow old configurations as valid? Why should an downgrade from 0.9.56 to 0.9.55 require a full new authentication on the very same system?

SharkWipf commented 8 years ago

I'd say a better fix would be to just make the executed binary execute the right, updated binary immediately, that way the (possibly read-only) executed binary can still be executed and the (r/w) binary in the user's home folder can still be updated. In fact, the only thing the downloaded binary would have to be is an updater/launcher, I don't see any reason why it should be doing anything more than that, the new binary is put into the .TelegramDesktop folder anyway.

The traditional way of relying on a package manager for updates is a bit of an issue. Most non-rolling distros stick to one major version of a program for the lifetime of their release, which is fine for server software, but for rapidly-updating internet facing desktop software it is a bit troublesome. Telegram would have to remain backwards compatible until distros are EOL, or force users of those distros to use a self-installed version, defeating the point of the package manager.

I'd suggest making the main application purely be an updater/launcher, which would fix this problem, and make packaging it easier as well.

john-preston commented 8 years ago

@5chdn Why don't you just download+unpack the version to some ~/tdesktop folder and launch it from there? The updater works fine that way.

5chdn commented 8 years ago

Most non-rolling distros stick to one major version of a program for the lifetime of their release, which is fine for server software, but for rapidly-updating internet facing desktop software it is a bit troublesome.

Never understood non-rolling releases unless you run a server.

I'd suggest making the main application purely be an updater/launcher, which would fix this problem, and make packaging it easier as well.

Can not see how this works out regarding permissions. Telegram has no permissions to upgrade software on my computer, and will never have for obvious reasons.

Why don't you just download+unpack the version to some ~/tdesktop folder and launch it from there?

For the lack of convenience, I can not keep track of all packages installed on my systems and therefore I'm using a package manager like every linux distribution offers. Installing telegram like any other package from the repositories allows me just to use it without messing my system with custom path and binary locations.

After keeping logged out of telegram on all my machines each day, I came here to suggest two simple solutions which are both (in my eyes) trivial and not messy:

If you do not want to do this, I'm totally fine with manually disabling auto updates on all my devices. However, I see a lot of pain in this thread and just wanted to be constructive.

SharkWipf commented 8 years ago

Never understood non-rolling releases unless you run a server.

A lot less tech-savvy Linux desktop users will be stuck to distros like Ubuntu, Mint or Fedora. Arch, Gentoo, Debian Sid, etc are not an option for them. Maybe LMDE.

Can not see how this works out regarding permissions.

Exactly the same as it works now, the launched binary just updates the ~/.TelegramDesktop/Telegram file like it already does, but then launches that and exits, instead of current behaviour.

  • keep logins valid through different versions

That might be less trivial than it originally sounds, and is quite possibly the original reason they opted for auto-updating over depending on package managers in the first place. Protocols may (have to) change, regardless of reason. Sometimes backwards compatibility is not an option due to security issues, or pushes extra, unnecessary workload on the developers.

IMO, in some cases, disabling automatic updates, or at least disabling built-in updaters and relying only on package managers, can be a bigger security risk than just letting the application update itself (with care, of course).

john-preston commented 8 years ago

@5chdn I'm not sure what are the binaries provided by your repositories and where do they come from, but if it is a custom build of telegram desktop from the source files located here the author of the package can easily disable auto update in the source code by a TDESKTOP_DISABLE_AUTOUPDATE macro.

rhoit commented 8 years ago

i'm using telegram-desktop-bin-dev from yaourt in arch, having same problem.


UPDATE: FIXED WITH THE NEW VERSION

cookiengineer commented 8 years ago

Had same problem using the telegram-desktop-bin and telegram-desktop-bin-dev from AUR. Switched to the official binaries from the website and just moved it to /opt/telegram/Telegram and symlinked it.

Worked fine with binaries, but I guess I will get updating problems in future.

gvlasov commented 8 years ago

Had the same issue, https://github.com/telegramdesktop/tdesktop/issues/960#issuecomment-146177958 solved it for me. I had my Telegram binary at ~/.bin/Telegram. I changed it to a symlink to ~/.TelegramDesktop/Telegram, and now it works properly.

atomAltera commented 7 years ago

Any updates here?

john-preston commented 7 years ago

@atomAltera 1. What OS do you use?

  1. Where is Telegram binary located?

  2. Do you use Telegram from https://desktop.telegram.org or from some other installation?

atomAltera commented 7 years ago

@john-preston I'm using BunsenLabs (based on Debian 8). Yes, I downloaded official binaries from https://desktop.telegram.org/ (Telegram and Updater) They are located in ~/opt/Telegram/ and I have symlink from ~/bin/telegram -> ~/opt/Telegram/Telegram

rugubara commented 7 years ago

versions 1.1.9 and 1.1.10 exhibit the same problem for me. I've removed ~/.TelegramDesktop and restarted the client. the directory was not re-created. I'm being asked for the verification code every time I start the app. I'm on Gentoo and telegram is part of the main repository. I've checked the source url of the ebuild - it's from updates.tdesktop.com