gilesknap / gphotos-sync

Google Photos and Albums backup with Google Photos Library API
Apache License 2.0
1.97k stars 163 forks source link

Authentication Flow Failing with Docker on Unraid #357

Closed mabartuccio closed 2 years ago

mabartuccio commented 2 years ago

Until yeesterday it worked very fine, with le last update i receive the follow error: 05-18 13:26:23 WARNING gphotos-sync 3.0.0 2022-05-18 13:26:23.173839 05-18 13:26:23 WARNING EXITING: database is locked i made a total uninstall and a fresh installation, same problem, any idea?

gilesknap commented 2 years ago

@mabartuccio, please can you try deleting the file in your root folder called gphotos.lock.

Also, let me know what OS you are running on and what filesystem your root folder is in.

Finally please post the command line you are invoking gphotos-sync with

Thanks,

mabartuccio commented 2 years ago

Thank you, i use the docker on Unraid, it worked fine for 2 years, with last update is noto more possible to update the token, this is the message error: root@c95bb2df8c73:/# gphotos-sync --new-token /storage/ 05-19 18:08:31 WARNING gphotos-sync 3.0.0 2022-05-19 18:08:31.977998 Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=335516456789-ddes8j9jr9qt9q8nuuc8v3ladu9mat9j.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fphotoslibrary.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fphotoslibrary.sharing&state=zidcUKoSiAQoVsFupK1jCWirratgji&access_type=offline

i got a blank page

the URL is: http://localhost:8080/?state=CrmS94SBFgHHrCmdYdVEFPqx8jBHM5&code=7/0AX4XfWgfkz4SJQsp8448MLN4z2iAvuLd41vhIMN9xv1cr8vkGCh5k3vOLOaCf_9AnCqmNg&scope=https://www.googleapis.com/auth/photoslibrary.sharing%20https://www.googleapis.com/auth/photoslibrary.readonly

p.s. i'm not a LINUX expert ! sorry

synman commented 2 years ago

You just leaked your token.... It is in the "code" querystring item.

mabartuccio commented 2 years ago

:-) no i changed some numbers e some letters in the token

gilesknap commented 2 years ago

@mabartuccio I take it from the 2nd URL you posted that you are seeing the Google Authorization pages and then getting a blank page on the redirect?

If this is the case then you may be seeing #356.

Did you use --nethost --it as described here? https://gilesknap.github.io/gphotos-sync/main/tutorials/installation.html#execute-in-a-container

mabartuccio commented 2 years ago

Thanks for replying, unfortunately nothing to do, I always get a blank page, everything happened after the latest docker update, always worked fine for several years.

gilesknap commented 2 years ago

@mabartuccio you said you are using Unraid. So gphotos-sync is on a server? Are you also running the browser on the server somehow?

The new authentication flow can only run fully on localhost so you need to have a browser on the same machine as gphotos-sync in order to do the initial run with authentication (but this should only ever be needed once). The very latest version on DockerHub has dropped the need to use --network=host. Instead you can use -p 8080:8080 which should work on all versions of Docker. See updated docs at https://gilesknap.github.io/gphotos-sync/main/tutorials/installation.html#execute-in-a-container

This unfortunate restriction (localhost authentication only) is a result of Google deprecating the old way of creating tokens and us unavoidable.

mabartuccio commented 2 years ago

Thnaks for reply, i installed a Firefox Browser on my Unraid, so it's the same machine, but the answer is the same:

Impossibile raggiungere il sitoConnessione negata da localhost. Prova a:

Verificare la connessione Controllare il proxy e firewall ERR_CONNECTION_REFUSED

This is the URL for authentication: http://localhost:8080/?state=XXXXXXXXXXXXXXXXXXXXXXX73YCFnhPnoZw&code=4/1AX4XfWgU3nHEWv_sItH1pH2iOKsH0yXXXtCkt12cLNs04pRH8HGSgfRY3q_nRldnKZWIPw&scope=https://www.googleapis.com/auth/photoslibrary.readonly%20https://www.googleapis.com/auth/photoslibrary.sharing

(changed only my token)

Thank you for help, i'm not a Linux expert, sorry.

gilesknap commented 2 years ago

OK, this looks like the issue we fixed in #358 so please can you check the following:

mabartuccio commented 2 years ago

Thank you very much for reply, hope i well understood, (i do not have experience with programming) i mus to edit the file "authorize.py" located on src/gphotos_sync/ of my docker and add the follow two lines after row 95?

Thank you for yu patience ! :-)

open_browser=False, bind_host="0.0.0.0", port=self.port open_browser=False, bind_addr="0.0.0.0", port=self.port

gilesknap commented 2 years ago

Hi @mabartuccio. You should not need to edit the code inside of your container. You should just make sure your container is launched with the latest image like this:

docker run --rm -v $CONFIG:/config -v $STORAGE:/storage -p 8080:8080 -it ghcr.io/gilesknap/gphotos-sync:3.04 /storage

with $CONFIG = the folder on your host machine with your client_secret.json and $STORAGE = the folder on your host machine where your backup will go

See the documentation for more details: https://gilesknap.github.io/gphotos-sync/main/tutorials/installation.html#execute-in-a-container

mabartuccio commented 2 years ago

I made a reboot of my UNRAID with GUI, so using the browser i'm inside local host, but is not to possible to generate the toke, i receive a blank page, this is the URL: http://localhost:8080/state=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&code=4/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxscope=https://www.googleapis.com/auth/photoslibrary.sharing https://www.googleapis.com/auth/photoslibrary.readonly

gilesknap commented 2 years ago

I'm not sure what is happening here, your issue seems unique.

What browser are you using? Can you post the source of the blank page you are seeing?

gilesknap commented 2 years ago

Please can you also send the command line that is launching docker?

mabartuccio commented 2 years ago

SOLVED - Sorry to the late answer and thanks for the help, finally solved so: i installed Python on my desktop lauch the follow command: "gphotos-sync.exe C:\Users\Tech\Desktop\foto\" i authorize in the local machine, so i find on the "foto folder" of my desktop the " .gphotos.token " that simply copy to: " user > Google Photos > Google Photos Backup" that is my backp Google foto folder. It work fine ! thank you for your help, ufortunally i don't know any programming language.

gilesknap commented 2 years ago

@mabartuccio thanks for letting me know. Do you think the documentation could be improved to explain this process better?

mabartuccio commented 2 years ago

Yes of course, it will help peoples like me that ignore any programming language, it's simple to do also for me!

Il giorno dom 19 giu 2022 alle ore 08:26 Giles Knap < @.***> ha scritto:

@mabartuccio https://github.com/mabartuccio thanks for letting me know. Do you think the documentation could be improved to explain this process better?

— Reply to this email directly, view it on GitHub https://github.com/gilesknap/gphotos-sync/issues/357#issuecomment-1159627009, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHDXHNP4PBPIO7VQHHWA43VP24RLANCNFSM5WJB6RFA . You are receiving this because you were mentioned.Message ID: @.***>

--

=================================== Mario Bartuccio Via Candurra, 128 9400 ENNA - ITALY Tel: 09351976618 | Mobile: 331 6772820 *✉ @. @.> *

Questa comunicazione e ogni eventuale file allegato sono confidenziali e destinati all'uso esclusivo del destinatario. Qualora non siate i destinatari della comunicazione, qualsiasi azione, copia, comunicazione, divulgazione o simili basate sul contenuto della comunicazione potrebbe violare norme di legge (art. 679/2016 GDPR).Se avete ricevuto questo messaggio per errore Vi preghiamo di darne immediata notizia al mittente (a mezzo telefono, fax o e-mail), eliminando in modo definitivo; il messaggio originale e ogni file allegato senza farne copia alcuna e/o senza riprodurne in alcun modo il contenuto.Il mittente, tenuto conto del mezzo utilizzato non si assume alcuna responsabilità in ordine alla segretezza e riservatezza delle informazioni contenute nella presente comunicazione via e-mail.

gilesknap commented 2 years ago

@mabartuccio if you read the last paragraph of https://gilesknap.github.io/gphotos-sync/main/tutorials/installation.html#execute-in-a-container is it clear? Is there something confusing? or is it simply not highlighted enough?

Thanks

mabartuccio commented 2 years ago

😀 simply i'm zero with programming

Il giorno dom 19 giu 2022 alle ore 08:37 Giles Knap < @.***> ha scritto:

@mabartuccio https://github.com/mabartuccio if you read the last paragraph of https://gilesknap.github.io/gphotos-sync/main/tutorials/installation.html#execute-in-a-container is it clear? Is there something confusing? or is it simply not highlighted enough?

Thanks

— Reply to this email directly, view it on GitHub https://github.com/gilesknap/gphotos-sync/issues/357#issuecomment-1159629025, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHDXHMDSWIKZHHFJTEYXQLVP2535ANCNFSM5WJB6RFA . You are receiving this because you were mentioned.Message ID: @.***>

--

=================================== Mario Bartuccio Via Candurra, 128 9400 ENNA - ITALY Tel: 09351976618 | Mobile: 331 6772820 *✉ @. @.> *

Questa comunicazione e ogni eventuale file allegato sono confidenziali e destinati all'uso esclusivo del destinatario. Qualora non siate i destinatari della comunicazione, qualsiasi azione, copia, comunicazione, divulgazione o simili basate sul contenuto della comunicazione potrebbe violare norme di legge (art. 679/2016 GDPR).Se avete ricevuto questo messaggio per errore Vi preghiamo di darne immediata notizia al mittente (a mezzo telefono, fax o e-mail), eliminando in modo definitivo; il messaggio originale e ogni file allegato senza farne copia alcuna e/o senza riprodurne in alcun modo il contenuto.Il mittente, tenuto conto del mezzo utilizzato non si assume alcuna responsabilità in ordine alla segretezza e riservatezza delle informazioni contenute nella presente comunicazione via e-mail.

gilesknap commented 1 year ago

Well I still think I'll put in a heading to highlight the headless case :-)

Glad we got you up and running. Thanks for the report.

On Sun, 19 Jun 2022 at 07:40, mabartuccio @.***> wrote:

😀 simply i'm zero with programming

Il giorno dom 19 giu 2022 alle ore 08:37 Giles Knap < @.***> ha scritto:

@mabartuccio https://github.com/mabartuccio if you read the last paragraph of

https://gilesknap.github.io/gphotos-sync/main/tutorials/installation.html#execute-in-a-container is it clear? Is there something confusing? or is it simply not highlighted enough?

Thanks

— Reply to this email directly, view it on GitHub < https://github.com/gilesknap/gphotos-sync/issues/357#issuecomment-1159629025 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AZHDXHMDSWIKZHHFJTEYXQLVP2535ANCNFSM5WJB6RFA

. You are receiving this because you were mentioned.Message ID: @.***>

--

=================================== Mario Bartuccio Via Candurra, 128 9400 ENNA - ITALY Tel: 09351976618 | Mobile: 331 6772820 *✉ @. @.> *

Questa comunicazione e ogni eventuale file allegato sono confidenziali e destinati all'uso esclusivo del destinatario. Qualora non siate i destinatari della comunicazione, qualsiasi azione, copia, comunicazione, divulgazione o simili basate sul contenuto della comunicazione potrebbe violare norme di legge (art. 679/2016 GDPR).Se avete ricevuto questo messaggio per errore Vi preghiamo di darne immediata notizia al mittente (a mezzo telefono, fax o e-mail), eliminando in modo definitivo; il messaggio originale e ogni file allegato senza farne copia alcuna e/o senza riprodurne in alcun modo il contenuto.Il mittente, tenuto conto del mezzo utilizzato non si assume alcuna responsabilità in ordine alla segretezza e riservatezza delle informazioni contenute nella presente comunicazione via e-mail.

— Reply to this email directly, view it on GitHub https://github.com/gilesknap/gphotos-sync/issues/357#issuecomment-1159629577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHLRW47OSGYTCVM4OCUIHDVP26GBANCNFSM5WJB6RFA . You are receiving this because you modified the open/close state.Message ID: @.***>