l3v11 / SearchX

The Ultimate Telegram Bot for Google Drive
https://t.me/l3v11
GNU General Public License v3.0
195 stars 284 forks source link

Token.json missing error on VPS #31

Closed leonard4546 closed 1 year ago

leonard4546 commented 1 year ago

app_1 | 2022-12-21 16:29:27,200 - bot - ERROR - The token.json file is missing app_1 | 2022-12-21 16:29:27,205 - google.auth._default - WARNING - Authentication failed using Compute Engine authentication due to unavailable metadata server. app_1 | 2022-12-21 16:29:27,206 - telegram.ext.dispatcher - ERROR - No error handlers are registered, logging exception. app_1 | Traceback (most recent call last): app_1 | File "/usr/local/lib/python3.8/dist-packages/telegram/ext/utils/promise.py", line 96, in run app_1 | self._result = self.pooled_function(*self.args, self.kwargs) app_1 | File "/usr/src/app/bot/modules/list.py", line 20, in list_drive app_1 | gd = GoogleDriveHelper() app_1 | File "/usr/src/app/bot/helper/drive_utils/gdriveTools.py", line 68, in init app_1 | self.service = self.authorize() app_1 | File "/usr/src/app/bot/helper/drive_utils/gdriveTools.py", line 104, in __authorize app_1 | return build('drive', 'v3', credentials=creds, cache_discovery=False) app_1 | File "/usr/local/lib/python3.8/dist-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper app_1 | return wrapped(*args, *kwargs) app_1 | File "/usr/local/lib/python3.8/dist-packages/googleapiclient/discovery.py", line 298, in build app_1 | service = build_from_document( app_1 | File "/usr/local/lib/python3.8/dist-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper app_1 | return wrapped(args, kwargs) app_1 | File "/usr/local/lib/python3.8/dist-packages/googleapiclient/discovery.py", line 580, in build_from_document app_1 | credentials = _auth.default_credentials( app_1 | File "/usr/local/lib/python3.8/dist-packages/googleapiclient/_auth.py", line 57, in default_credentials app1 | credentials, = google.auth.default( app_1 | File "/usr/local/lib/python3.8/dist-packages/google/auth/_default.py", line 653, in default app_1 | raise exceptions.DefaultCredentialsError(_HELP_MESSAGE) app_1 | google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started

I'm getting this error, I'm hosting it on VPS. Bot is starting but throwing this error if I try to find something.

token.json file is present in directory as well as in config.

l3v11 commented 1 year ago

Are you using the latest commit? And how did you generate the token.json file?

leonard4546 commented 1 year ago

Are you using the latest commit? And how did you generate the token.json file?

I'm using same from my mirror bot, and converted it to json using your script.

l3v11 commented 1 year ago

Probably your token has been expired. Regenerate it again.

leonard4546 commented 1 year ago

Probably your token has expired. Regenerate it again.

I regenerated it, still same error. I tried generating using your scrip. but not able to understand Ui on linux terminal.

l3v11 commented 1 year ago

Run the script on your computer, not on VPS

leonard4546 commented 1 year ago

Run the script on your computer, not on VPS

Okk, Generated on computer, and yet same error

l3v11 commented 1 year ago

What don't you understand? I don't get it.

l3v11 commented 1 year ago

Send me your token.json file at @l3v11 and I will take a look.

l3v11 commented 1 year ago

Closing this issue as further help is not required it seems.