GAM-team / got-your-back

Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.
https://github.com/GAM-team/got-your-back/wiki
Apache License 2.0
2.6k stars 205 forks source link

GYB won't create a new oauth2service.json when using --config-folder for custom location #352

Open epifeny opened 2 years ago

epifeny commented 2 years ago

I'm using this command to generate a backup of my Gmail account (personal account, not workspace/gsuite)

~/bin/gyb/gyb --config-folder ./Gmail-<redacted> --action create-project --email <redacted>@gmail.com

And the output is this

Creating project "Got Your Back Project"...
Checking project status...
Please go to:
https://console.cloud.google.com/start
and accept the Terms of Service (ToS). As soon as you've accepted the ToS popup, you can return here and press enter.

Creating project "Got Your Back Project"...
Checking project status...
 enabling API drive.googleapis.com...
 enabling API gmail.googleapis.com...
 enabling API groupsmigration.googleapis.com...
 enabling API iap.googleapis.com...
 enabling API vault.googleapis.com...
Creating Service Account
ERROR: [Errno 2] No such file or directory: './Gmail-<redacted>/oauth2service.json'

* I've redacted the true email for obvious privacy reasons

Why won't it create the missing files it needs? Is this related to #345?

billdenney commented 2 years ago

TL;DR: Create the --config-folder directory before running the create-project command.

I'm having the same issue. I'm trying to track it down.

I'm running on Ubuntu 20.04. My process so far was:

After creating the directory, it got past the step.

The resolution to the issue could be one of two options, to me:

  1. When running with --action create-project, if the --config-folder does not exist, prompt the user to create it.
  2. The user can create the directory manually before running the create-project command.