[solved]No such device or address, with a broken token

After searching through discourse, still no luck =(

I am cloning a private repo from gitea, and got the error:

fatal: could not read Username for ‘https://gitea.hostname.com’: No such device or address

My environment:

  • Gitea 1.8
  • Drone 1.1.0

Drone Env:

DRONE_KUBERNETES_ENABLED: true
DRONE_KUBERNETES_NAMESPACE: drone
DRONE_KUBERNETES_SERVICE_ACCOUNT: cnc-drone-pipeline
DRONE_GIT_ALWAYS_AUTH: true
DRONE_SERVER_HOST: drone.hostname.com
DRONE_SERVER_PROTO: https
DRONE_USER_CREATE: username:luis,machine:false,admin:true,token: Access_Tokens_Generate_From_Gitea
DRONE_RPC_SECRET: Secret: cnc-drone-rpc-secret
DRONE_DATABASE_DATASOURCE: user:[email protected](host:3306)/drone?parseTime=true&charset=utf8mb4
DRONE_DATABASE_DRIVER: mysql
DRONE_LOGS_TRACE:
DRONE_GITEA_SERVER: https://gitea.hostname.com
DRONE_GITEA_CLIENT_ID: Client_ID_Generate_From_Gitea
DRONE_GITEA_CLIENT_SECRET: Client_SECRET_Generate_From_Gitea

Already tried:

  1. checked repo is in private

+ drone repo info org/repo
Owner: org
Repo: repo
Config: .drone.yml
Visibility: private
Private: true
Trusted: false
Protected: false
Remote: https://gitea.hostname.com/org/repo.git

  1. checked .netrc got the token, and when i paste it into jwt.io to see what’s in payload, there’s no useful info about the user. And it’s not able to clone, then i tried using https://username:[email protected], it worked.
clone:
  disable: true

steps:
  - name: clone
    image: docker:git
    commands:
      - echo $DRONE_REPO_PRIVATE
      - cat /root/.netrc
      - git clone https://[email protected]/org/repo.git
+ echo $DRONE_REPO_PRIVATE
2 true
3 + cat /root/.netrc
4 machine gitea.hostname.com
5 login eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjEsInR0IjowLCJleHAiOjE1NTY2MTkxOTMsImlhdCI6MTU1NjYxNTU5M30.jAMsdZ0xDapVHD7xs6a3Oridbmc4ZxQwc_98Y0SE4m8QpnKTW2ENy3zQ6jbXRsxbCL_NCKv6g7Eb8_Yon6ADyA
6 password x-oauth-basic
+ git clone https://eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjEsInR0IjowLCJleHAiOjE1NTY2MTg4MjUsImlhdCI6MTU1NjYxNTIyNX0.B_5NWxAmmr_GBGIsUDoVUBj[email protected]gitea.hostname.com/org/repo.git
Cloning into 'repo'...
fatal: could not read Password for 'https://eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjEsInR0IjowLCJleHAiOjE1NTY2MTg4MjUsImlhdCI6MTU1NjYxNTIyNX0.B_5NWxAmmr_GBGIsUDoVUBj[email protected]gitea.hostname.com': No such device or address

Does anyone facing the same issue, or solved it? Any help is appreciate!!

Hi @Luis

Please see response here: Gitea 1.8.0 and Drone 1.1.0 unable to clone repository (2FA)

1 Like

I’ve tried, the problem solved, Thank you @techknowlogick!

1 Like