TruncatedDinoSour / arigram

[Migrated to self-hosted ari-web Forgejo: https://git.ari.lt/ari/arigram] A fork of tg -- a hackable telegram TUI client [EOL https://github.com/TruncatedDinoSour/arigram/releases/tag/v0.1.8]
https://git.ari.lt/ari/arigram
The Unlicense
75 stars 6 forks source link

launch stalls with 'Valid api_|id must be provided #19

Open plum opened 1 year ago

plum commented 1 year ago

Ho, looks really good, but this error occurs, implyiing app_id authentication.

raise RuntimeError(f'Telegram error: {self.error_info}') RuntimeError: Telegram error: {'@type': 'error', 'code': 400, 'message': 'Valid api_id must be provided. Can be obtained at https://my.telegram.org', '@extra': {'request_id': 'updateAuthorizationState'}}

Arigram was installed from aur community package , V. 0.1.6-1

I dont have an app_id myself , although i have a telegram account of course. I had expected the ap_id would be registered somehwhere in the installe d package.

My telephone number, as entered on the command after arigram, has been recorded in the arigram/config.py

Any help, appreciated. John

TruncatedDinoSour commented 1 year ago

im sorry to hear that

to clearify, i half abandoned this project and i barely work on it anymore these days and i dont maintain the aur package so i dont know whats going on

the app_id is already pre-packaged into the client https://github.com/TruncatedDinosour/arigram/blob/main/arigram/config.py#L25..L26 so im very confused why such error would happen, maybe you overwrote it somehow, maybe even in config.py ?

maybe some other arigram users know, but i even now currently have arigram open and its fine, very concerned why its broken for you :/ if anything lmk :)

ghost commented 1 year ago

I have this error. Changed API_ID and API_HASH to mine, recompiled. Same error. Probably, something changed in telegram api idk. Not a python dev so can't really check

TruncatedDinoSour commented 1 year ago

I have this error. Changed API_ID and API_HASH to mine, recompiled. Same error. Probably, something changed in telegram api idk. Not a python dev so can't really check

thats odd, weirdly still works for me and i doubt its anything with the api as i try to keep up with the changes, if it was gonna happen itd happen to me too

TruncatedDinoSour commented 1 year ago

maybe the AUR package is broken or something ? i dont maintain it though

ghost commented 1 year ago

I installed from sources.

My OS:

Distributor ID: Elementary
Description:    elementary OS 6.1 Jólnir
Release:    6.1
Codename:   jolnir
TruncatedDinoSour commented 1 year ago

I installed from sources.

My OS:

Distributor ID:   Elementary
Description:  elementary OS 6.1 Jólnir
Release:  6.1
Codename: jolnir

maybe this fixes it ? i bumped the python tg version https://github.com/TruncatedDinosour/arigram/releases/tag/v0.1.7

bogdanbryzh commented 1 year ago

I installed from sources.

My OS:

Distributor ID: Elementary
Description:    elementary OS 6.1 Jólnir
Release:    6.1
Codename:   jolnir

maybe this fixes it ? i bumped the python tg version https://github.com/TruncatedDinosour/arigram/releases/tag/v0.1.7

I'll try in a moment. Will notify

TruncatedDinoSour commented 1 year ago

just in case, ill leave the house for now as i got plans with my best friend, ill be back in a couple of hours, sorry for the delay in responses in advance, id give 24/7 support if i could, but im just a teenage developer, not a large tech company <33

bogdanbryzh commented 1 year ago

dude, relax, you don't owe me or anybody else anything. have a great one 🫡

bogdanbryzh commented 1 year ago

unfortunately, error persists

Screenshot from 2023-03-06 16-41-43 Screenshot from 2023-03-06 16-42-04

bogdanbryzh commented 1 year ago

tried creating fresh user on system - same

TruncatedDinoSour commented 1 year ago

unfortunately, error persists

Screenshot from 2023-03-06 16-41-43 Screenshot from 2023-03-06 16-42-04

this is so odd, ill try and research it

TruncatedDinoSour commented 1 year ago

mpv-shot0002

this is with ~/.config/arigram and ~/.cache/arigram removed, it all works, im so lost, why am i unable to reacreate the error

bogdanbryzh commented 1 year ago

wait, I didn't try purging cache. will be back in a sec

bogdanbryzh commented 1 year ago

well, apparently I don't have cache for arigram

TruncatedDinoSour commented 1 year ago

well, apparently I don't have cache for arigram

i guess its because you havent even been able to log in

bogdanbryzh commented 1 year ago

I will try installing arigram on virtual machine. Hope it'll work

TruncatedDinoSour commented 1 year ago

its still very suspicious that it even breaks on 2 systems

TruncatedDinoSour commented 1 year ago

I will try installing arigram on virtual machine. Hope it'll work

ill try it on a fresh void linux vm too

TruncatedDinoSour commented 1 year ago

mpv-shot0001 this is a fully fresh void linux vm, still works, so lost still, looking up the error isnt much helpful either

plum commented 1 year ago

@ truncatedDinosaur I did grab the app ID from package files and entered them into my local conf, but the error persists.

TruncatedDinoSour commented 1 year ago

@ truncatedDinosaur I did grab the app ID from package files and entered them into my local conf, but the error persists.

yeah, i know, its probably not related to that, the problem in it is that i am unable to reproduce it no matter what, im unsure whats so broken that makes your arigram install scream

ghost commented 1 year ago

installed on fresh Ubuntu 22.04. Had an issue with libssl.so.1.1 Screenshot from 2023-03-07 16-44-06 resolved thanks to https://stackoverflow.com/a/73604364

ghost commented 1 year ago

but now arigram works just fine

TruncatedDinoSour commented 1 year ago

but now arigram works just fine

hm, but now why is it broken for you two

plum commented 1 year ago

@bogdan: OK, that's useful I'll check out the lib.ssl.so issue in some way or another. I dimly recall I have had issues with libssl.so in the past with some other applications, and managed to resolve it, but without a fresh install of my system.

TruncatedDinoSour commented 1 year ago

@bogdan: OK, that's useful I'll check out the lib.ssl.so issue in some way or another. I dimly recall I have had issues with libssl.so in the past with some other applications, and managed to resolve it, but without a fresh install of my system.

so, any update ?

r-scheffler commented 1 year ago

hey, got the same issue after a fresh arch install.

TruncatedDinoSour commented 1 year ago

hey, got the same issue after a fresh arch install.

hihi, we still dont know what the cause is, if you figure it out, please tell us <3

plum commented 1 year ago

On arch I see there are two lib32-openssl packages: perhaps that is the cause of the problem

$ pacman -Ss openssl


multilib/lib32-openssl 1:3.0.8-1 [installed]
    The Open Source toolkit for Secure Sockets Layer and Transport Layer Security (32-bit)
multilib/lib32-openssl-1.1 1.1.1.t-1
    The Open Source toolkit for Secure Sockets Layer and Transport Layer Security

These provide the lib.ssl.so file. As you can see, I'm on the later version, and reported the problem as an issue. I could try swapping the round and testing, OR meanwhile, you could let me know, which version you are running.

TruncatedDinoSour commented 1 year ago

On arch I see there are two lib32-openssl packages: perhaps that is the cause of the problem

$ pacman -Ss openssl


multilib/lib32-openssl 1:3.0.8-1 [installed]
    The Open Source toolkit for Secure Sockets Layer and Transport Layer Security (32-bit)
multilib/lib32-openssl-1.1 1.1.1.t-1
    The Open Source toolkit for Secure Sockets Layer and Transport Layer Security

These provide the lib.ssl.so file. As you can see, I'm on the later version, and reported the problem as an issue. I could try swapping the round and testing, OR meanwhile, you could let me know, which version you are running.

i use openssl version 1.1.1, gentoos latest

bogdanbryzh commented 1 year ago

interestingly enough it works on EndevourOS just fine. No python errors, no openssl errors, nothing.

TruncatedDinoSour commented 1 year ago

interestingly enough it works on EndevourOS just fine. No python errors, no openssl errors, nothing.

yeah, its unreproducable on my gentoo, nor on a void vm, nothing, idk whats up, no clue what to fix

plum commented 1 year ago

Form what's been reported so far I think we can conclude the key is valid and it should be read with OK with required dependencies. Therefore, It seems like it could be down to the aur package. It is actively maintained and Imyself coul dnot see any obvious problems there, when taking a breif look: Here are the details;

[aur arigram.git](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=arigram :) root/pckbuild:

 Maintainer: Onur BÜBER <onurbuber@engineer.com>
# Developer: Ari Archer <ari.web.xyz@gmail.com>

pkgname=arigram
pkgver=0.1.6
pkgrel=1
pkgdesc='A fork of tg -- a hackable telegram TUI client'
arch=('x86_64')
url='https://github.com/TruncatedDinosour/arigram.git'
license=('Unlicense')
provides=('arigram')
conflicts=('arigram')
optdepends=('ffmpeg'
            'nnn'
            'fzf'
            'ranger')
makedepends=('python'
             'python-pip'
             'python-telegram'
             'python-pyfzf'
             'python-pyperclip'
             'bash'
             'git')
source=("$pkgname-$pkgver.tar.gz::https://github.com/TruncatedDinosour/arigram/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('f3319df1990805c977b3759a67228793dc67f78ed9c21f9098ffade0095d35f0')

build() {
    cd "$srcdir/$pkgname-$pkgver"
    python setup.py build

}

package() {
    cd "$srcdir/$pkgname-$pkgver"
    python setup.py install --root="$pkgdir"
    install -Dm644 UNLICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

It's pulling arigram version 0.1.6.1

$ pacman -Qi arigram

Name            : arigram
Version         : 0.1.6-1
Description     : A fork of tg -- a hackable telegram TUI client
Architecture    : x86_64
URL             : https://github.com/TruncatedDinosour/arigram.git

I've just now posted this issue to the package maintainer for his comments on this problem experienced by only arch users.

TruncatedDinoSour commented 1 year ago

im guessing the issue is solved so ill close it, thank you for active convo when needed

Yehoward commented 11 months ago

Not solved, yet. I have the problem both from built version and from AUR. What's even weirder is that I didn't have the problem from the start. It ran "fine", the only serious error being that I couldn't type. I solved it (in controllers.py at the line 582 changed the permission can_send_message to can_send_basic_message), and it worked fine for a bit, then it gave me a RuntimeError: Telegram error: {'@type': 'error', 'code': 400, 'message': 'Valid api_id must be provided. Can be obtained at https://my.telegram.org', '@extra': {'request_id': 'updateAuthorizationState'}}. I tried a different API id, and still doesn't work.

Even though in my case it may seem as an user error, I highly doubt it.

TruncatedDinoSour commented 11 months ago

Not solved, yet. I have the problem both from built version and from AUR. What's even weirder is that I didn't have the problem from the start. It ran "fine", the only serious error being that I couldn't type. I solved it (in controllers.py at the line 582 changed the permission can_send_message to can_send_basic_message), and it worked fine for a bit, then it gave me a RuntimeError: Telegram error: {'@type': 'error', 'code': 400, 'message': 'Valid api_id must be provided. Can be obtained at https://my.telegram.org', '@extra': {'request_id': 'updateAuthorizationState'}}. I tried a different API id, and still doesn't work.

Even though in my case it may seem as an user error, I highly doubt it.

sorry, ion rlly work on this anymore, the current state of this project is 'if it works for me its good enough for everyone' and what id suggest is forking this, i am sorry for the accumulating errors and functionality loss over time, ill reopen this just in case the community wants to solve this or yall wanna advertise any forks

Yehoward commented 11 months ago

Not solved, yet. I have the problem both from built version and from AUR. What's even weirder is that I didn't have the problem from the start. It ran "fine", the only serious error being that I couldn't type. I solved it (in controllers.py at the line 582 changed the permission can_send_message to can_send_basic_message), and it worked fine for a bit, then it gave me a RuntimeError: Telegram error: {'@type': 'error', 'code': 400, 'message': 'Valid api_id must be provided. Can be obtained at https://my.telegram.org', '@extra': {'request_id': 'updateAuthorizationState'}}. I tried a different API id, and still doesn't work. Even though in my case it may seem as an user error, I highly doubt it.

sorry, ion rlly work on this anymore, the current state of this project is 'if it works for me its good enough for everyone' and what id suggest is forking this, i am sorry for the accumulating errors and functionality loss over time, ill reopen this just in case the community wants to solve this or yall wanna advertise any forks

Yes, I understand. I'll try to fix it, and if I succeed I'll let you know.

Yehoward commented 11 months ago

I found the error, and it was a user one. I was using python-telegram 0.17.0 which doesn't support the latest version of TDLib. I updated python-telegram to 0.18.0 and everything works.

What's even weirder is that I didn't have the problem from the start. It ran "fine", the only serious error being that I couldn't type.

I bet that was caused by the fact that I had two python-telegram packages installed, one from AUR with the latest version and one from pip. You may want to change the python-telegram version in pyproject.toml to "^0.18.0".

TruncatedDinoSour commented 9 months ago

hey, as this issue is still open i'd like to make it clear that this project has had its final release and i encourage to go find or start other arigram forks

https://github.com/TruncatedDinoSour/arigram/releases/tag/v0.1.8 https://github.com/TruncatedDinoSour/arigram/forks https://github.com/TruncatedDinoSour/arigram/#featured-forks