Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mcathena opened this issue Apr 18, 2024 · 4 comments
Open

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

mcathena opened this issue Apr 18, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@mcathena
Copy link

mcathena commented Apr 18, 2024

问题描述
无法使用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>'
@mcathena mcathena added the bug Something isn't working label Apr 18, 2024
@icyleaf
Copy link
Owner

icyleaf commented Apr 19, 2024

应该是 gitlab 16 改了 API 结构,好久没适配了。

BTW,上来就贴 Python 代码是让我现学吗(笑)

@mcathena
Copy link
Author

应该是 gitlab 16 改了 API 结构,好久没适配了。

BTW,上来就贴 Python 代码是让我现学吗(笑)

好的,感谢回复😂。请问近期有更新hpr的计划吗?如果没有我可能计划自己直接调用gitlab的api尝试实现一下。

@icyleaf
Copy link
Owner

icyleaf commented Apr 19, 2024

查了 Gitlab API 并没有发生变化,做了一点调整 88eaa5e

@icyleaf
Copy link
Owner

icyleaf commented Apr 19, 2024

试试 icyleafcn/hpr:nightly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants