Skip to content

无法使用api创建镜像仓库 #260

Open
@mcathena

Description

@mcathena

问题描述
无法使用api创建镜像仓库

填写完整问题的描述和复现的步骤

import requests
# API endpoint
api_endpoint = "http://124.223.177.10:8010/repositories"
# Repository URL to mirror
github_url = "https://github.com/icyleaf/hpr.git"

# API request data
data = {
    "url": "https://github.com/icyleaf/hpr.git"
}

# Username and password for basic authentication
username = "****"
password = "*******"

# Send API request with basic authentication
response = requests.post(api_endpoint, json=data, auth=(username, password))

# Check response status code
if response.status_code == 200:
    # Print job ID
    result = f"Mirror repository creation job ID: {response.json()['job_id']}"
    print(result)
else:
    # Print error message
    result = f"Error creating mirror repository: {response}"
    print(result)

返回结果

{
    "message": "undefined method `ssh_url_to_repo' for []:Gitlab::PaginatedResponse"
}

使用环境:

补充信息
补充提交 bug 的完整信息,如果有 hpr.logsidekiq.log 日志和 hpr.yml 配置文件为佳。

2024-04-18T08:46:56.764Z pid=52676 tid=12bw WARN: ArgumentError: concurrency: 0 is not a valid value
2024-04-18T08:46:56.765Z pid=52676 tid=12bw WARN: /usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:284:in `block in validate!'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:283:in `each'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:283:in `validate!'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:26:in `parse'
/usr/local/bundle/gems/sidekiq-6.1.2/bin/sidekiq:27:in `<top (required)>'
/app/bin/sidekiq:29:in `load'
/app/bin/sidekiq:29:in `<main>'
2024-04-18T08:46:57.738Z pid=52682 tid=12bm WARN: ArgumentError: concurrency: 0 is not a valid value
2024-04-18T08:46:57.740Z pid=52682 tid=12bm WARN: /usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:284:in `block in validate!'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:283:in `each'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:283:in `validate!'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:26:in `parse'
/usr/local/bundle/gems/sidekiq-6.1.2/bin/sidekiq:27:in `<top (required)>'
/app/bin/sidekiq:29:in `load'
/app/bin/sidekiq:29:in `<main>'
2024-04-18T08:46:58.751Z pid=52688 tid=12c8 WARN: ArgumentError: concurrency: 0 is not a valid value
2024-04-18T08:46:58.753Z pid=52688 tid=12c8 WARN: /usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:284:in `block in validate!'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:283:in `each'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:283:in `validate!'
/usr/local/bundle/gems/sidekiq-6.1.2/lib/sidekiq/cli.rb:26:in `parse'
/usr/local/bundle/gems/sidekiq-6.1.2/bin/sidekiq:27:in `<top (required)>'
/app/bin/sidekiq:29:in `load'
/app/bin/sidekiq:29:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions