Git Product home page Git Product logo

gupload's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gupload's Issues

request had insufficient authentication scopes error

Hi. I'm using gupload to upload my android apk from gitlab ci/cd to google drive. I created a service account on google cloud and downloaded the credentials and saved in gitlab environment variables. this my credentials:

`{
  "type": "service_account",
  "project_id": "**************435157288647-268",
  "private_key_id": "********ec6d3336a1705083adc9084fa0e884eb",
  "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBAD......\n-----END PRIVATE KEY-----\n",
  "client_email": "android-straiberry-ci@pc-api-61424124*****288647-268.iam.gserviceaccount.com",
  "client_id": "104981693329087082717",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/android-straiberry-ci%40pc-api-6142412435157288647-268.iam.gserviceaccount.com"
}`

and this is my pipeline job to upload the apk:

`assembleReleaseApkOnGoogleDrive:
  stage: internalOnGoogleDrive
  script:
    # Outpu the keystore 
    - base64 -d ${KEY_STORE_FILE} > my_keystore.jks
    # Output Playstore Service Account Key JSON to a runtime JSON file
    - echo $GCP_PLAYSTORE_SERIVCE_ACCOUNT_KEY_JSON > credentials.json
    - echo "storeFile=../my_keystore.jks" >> keystore.properties
    - echo "storePassword=${STORE_PASSWORD}" >> keystore.properties
    - echo "keyAlias=${KEY_ALIAS}" >> keystore.properties
    - echo "keyPassword=${KEY_PASSWORD}" >> keystore.properties
    - echo "playServiceAccountEmail=${GCP_PLAYSTORE_SERIVCE_ACCOUNT_EMAIL}" >> keystore.properties
    - ./gradlew clean --stacktrace --warning-mode=all
    - ./gradlew assembleFarsiRelease --stacktrace --warning-mode=all     
    - gupload --to 1T6LxAZg2BXVdGT7nJtIrlVa02mA4ZPod --file app-dentai-release.apk app/build/outputs/apk/farsi/release/app-farsi-release.apk `

But i'm getting this error and don't know what's wrong. I think something is wrong with my credentials.
request had insufficient authentication scopes

ImportError: cannot import name 'GoogleAuthw' from 'pydrive.auth'

Running from Colab the following

    !pip3 install --upgrade gupload
    from pydrive.auth import GoogleAuthw

gives the following error:

Requirement already satisfied: gupload in /usr/local/lib/python3.7/dist-packages (1.1.0)
Requirement already satisfied: click==7.0 in /usr/local/lib/python3.7/dist-packages (from gupload) (7.0)
Requirement already satisfied: google-api-python-client==1.7.10 in /usr/local/lib/python3.7/dist-packages (from gupload) (1.7.10)
Requirement already satisfied: uritemplate<4dev,>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client==1.7.10->gupload) (3.0.1)
Requirement already satisfied: google-auth>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client==1.7.10->gupload) (1.34.0)
Requirement already satisfied: google-auth-httplib2>=0.0.3 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client==1.7.10->gupload) (0.0.4)
Requirement already satisfied: httplib2<1dev,>=0.9.2 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client==1.7.10->gupload) (0.17.4)
Requirement already satisfied: six<2dev,>=1.6.1 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client==1.7.10->gupload) (1.15.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth>=1.4.1->google-api-python-client==1.7.10->gupload) (4.7.2)
Requirement already satisfied: setuptools>=40.3.0 in /usr/local/lib/python3.7/dist-packages (from google-auth>=1.4.1->google-api-python-client==1.7.10->gupload) (57.4.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth>=1.4.1->google-api-python-client==1.7.10->gupload) (4.2.2)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth>=1.4.1->google-api-python-client==1.7.10->gupload) (0.2.8)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth>=1.4.1->google-api-python-client==1.7.10->gupload) (0.4.8)

---------------------------------------------------------------------------

ImportError                               Traceback (most recent call last)

<ipython-input-8-e55af81a8b06> in <module>()
      1 get_ipython().system('pip3 install --upgrade gupload')
----> 2 from pydrive.auth import GoogleAuthw

ImportError: cannot import name 'GoogleAuthw' from 'pydrive.auth' (/usr/local/lib/python3.7/dist-packages/pydrive/auth.py)


---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

Any suggestions are highly appreciated!

Files are not uploaded to Google Drive if gupload is executed from cron

When i execute the command gupload /home/ubuntu/odoo15/develop/backup/ -c odoo_backup -d from the shell everything works fine. Files are uploaded to my Google drive folder. But when I schedule the same command in cron, files are not uploaded. Cron executes the command but files are not uploaded.

Crontab entry:
00 14 * * * gupload /home/ubuntu/odoo15/develop/backup/ -c odoo_backup -d

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.