jagrit007 / Telegram-CloneBot

[USE ALPHA BRANCH] Simple Bot to clone Google Drive Files (or Folders) to your Team Drive[or Normal Drive]. P.S This is not a Mirror Bot. Enjoy ✌🏻
MIT License
324 stars 455 forks source link

Error while using Service Accounts #6

Closed UsamaKarim closed 3 years ago

UsamaKarim commented 3 years ago

Logs while USE_SERVICE_ACCOUNTS is true

2020-10-09T12:00:29.359005+00:00 app[worker.1]: 2020-10-09 12:00:29,358 - bot - INFO - Authorizing with 0.json service account
2020-10-09T12:00:29.608422+00:00 app[worker.1]: 2020-10-09 12:00:29,608 - bot - INFO - File ID: 10MJ2vwavNELczT2nMvjKghcFft8tTfdC
2020-10-09T12:00:32.639252+00:00 app[worker.1]: 2020-10-09 12:00:32,638 - bot - ERROR - Message to edit not found

Message from telegram (Clone Unsuccessful)

HttpError 404 when requesting https://www.googleapis.com/drive/v3/files/10MJ2vwavNELczT2nMvjKghcFft8tTfdC?supportsAllDrives=true&fields=name%2Cid%2CmimeType%2Csize&alt=json returned "File not found: 10MJ2vwavNELczT2nMvjKghcFft8tTfdC."

Logs while USE_SERVICE_ACCOUNTS is false (Clone Successful)

2020-10-09T12:06:40.531246+00:00 app[worker.1]: 2020-10-09 12:06:40,530 - bot - ERROR - Can't parse entities: can't find end of the entity starting at byte offset 248
2020-10-09T12:06:45.553824+00:00 app[worker.1]: 2020-10-09 12:06:45,553 - bot - ERROR - Can't parse entities: can't find end of the entity starting at byte offset 325
2020-10-09T12:06:50.578583+00:00 app[worker.1]: 2020-10-09 12:06:50,578 - bot - ERROR - Can't parse entities: can't find end of the entity starting at byte offset 256
2020-10-09T12:06:55.601809+00:00 app[worker.1]: 2020-10-09 12:06:55,601 - bot - ERROR - Can't parse entities: can't find end of the entity starting at byte offset 310
2020-10-09T12:08:35.554561+00:00 app[worker.1]: 2020-10-09 12:08:35,554 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "userRateLimitExceeded"
2020-10-09T12:08:37.441123+00:00 app[worker.1]: 2020-10-09 12:08:37,440 - bot - ERROR - Message to edit not found
jagrit007 commented 3 years ago
  1. Make sure you have access to the file you are cloning. The account's credentials you use should be having permission to both read from source and write to destination.

  2. Make sure you haven't exceeded your daily quota of 750GB since you're not using Service Accounts.

Try cloning some public link, and check if it clones fine.

Also make sure your destination folder ID actually exists and that you can write there.

jagrit007 commented 3 years ago

As per your latest edit, I'd say your Service accounts are not added in the source folder. Add your service accounts to a google group and get that google group added to the source folder.

UsamaKarim commented 3 years ago

The SA are added into the folder of the bot repo. It gives other error if SA are not found.

I also tried cloning with public link but it gave same error

My quota is also not exceeded because I have not done any cloning/mirroring before

I have checked all other consequences but the issue still exist.

I added SA in teamdrive by your add_to_teamdrive script. I will try to add it in the group too