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:password@tcp(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:
- 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
- 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:password@gitea.hostname.com, it worked.
clone:
disable: true
steps:
- name: clone
image: docker:git
commands:
- echo $DRONE_REPO_PRIVATE
- cat /root/.netrc
- git clone https://token@gitea.hostname.com/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_GBGIsUDoVUBjlQiK3JRWNNi3PQ4ODH-ynVU1ah4jA5k7YMBZHMaMm4ovqwPqW2NRX4Wz58LONKQ@gitea.hostname.com/org/repo.git
Cloning into 'repo'...
fatal: could not read Password for 'https://eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjEsInR0IjowLCJleHAiOjE1NTY2MTg4MjUsImlhdCI6MTU1NjYxNTIyNX0.B_5NWxAmmr_GBGIsUDoVUBjlQiK3JRWNNi3PQ4ODH-ynVU1ah4jA5k7YMBZHMaMm4ovqwPqW2NRX4Wz58LONKQ@gitea.hostname.com': No such device or address
Does anyone facing the same issue, or solved it? Any help is appreciate!!