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

GitLab merge request. Could not read from remote repository error #9251

Closed
2 tasks done
timur-st94 opened this issue May 16, 2023 · 8 comments
Closed
2 tasks done

GitLab merge request. Could not read from remote repository error #9251

timur-st94 opened this issue May 16, 2023 · 8 comments

Comments

@timur-st94
Copy link

Describe the issue

When I try to create a merge request from selfhosted Weblate to selfhosted GitLab, I get an error

remote: The project you were looking for could not be found or you don't have permission to view it.
remote: 
remote: ========================================================================
remote: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
 (128)

After seeing the issue #9016
We changed rsa keys to ed25519 keys that appeared in weblate version: 4.17-2. Also checked that the key from the weblate completely matches the one that was added to the GitLab.

We use helm chart helm.sh/chart: weblate-0.4.24 to install
And use the docker image weblate/weblate:4.17-2

Environment variables have been set

WEBLATE_GITLAB_TOKEN: xxxxxx
WEBLATE_GITLAB_USERNAME: xxxxxx
WEBLATE_GITLAB_HOST: xxxxxx

If select git in the Version control system field in the settings, everything works
But if I change this field to GitLab merge request, I see an error

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Enter git SSH URL in Repository push URL field
  2. Сhose GitLab merge request in Version control system
  3. Go to the repository maintenance at the same component
  4. Click on Push
  5. Get the error message banner "Could not read from remote repository."

Expected behavior

No response

Screenshots

No response

Exception traceback

gunicorn stderr | [2023-05-16 07:33:39,379: INFO/370] updating repository
gunicorn stderr | [2023-05-16 07:33:39,929: INFO/370] update took 0.55 seconds
gunicorn stderr | [2023-05-16 07:33:39,933: INFO/370] repository up to date at 506fb96609bb15ddf82e03ded814c46d6593d998
gunicorn stderr | [2023-05-16 07:33:39,975: INFO/370] Acquired Lock('lock:lock:repo:6').
gunicorn stderr | [2023-05-16 07:33:39,975: INFO/370] pushing to remote repo
2023-05-16 07:33:40,242 INFO reaped unknown pid 1299 (exit status 1)
gunicorn stderr | [2023-05-16 07:33:40,242: WARNING/370] Could not push the repo: RepositoryException: remote: 
gunicorn stderr | remote: ========================================================================
gunicorn stderr | remote: 
gunicorn stderr | remote: The project you were looking for could not be found or you don't have permission to view it.
gunicorn stderr | remote: 
gunicorn stderr | remote: ========================================================================
gunicorn stderr | remote: 
gunicorn stderr | fatal: Could not read from remote repository.
gunicorn stderr | 
gunicorn stderr | Please make sure you have the correct access rights
gunicorn stderr | and the repository exists.
gunicorn stderr |  (128)
celery-notify stderr | [2023-05-16 07:33:40,249: INFO/MainProcess] Task weblate.accounts.tasks.notify_change[2b34391c-4298-41be-8347-61d38e7e400a] received

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 4.17
  • Django: 4.2
  • siphashc: 2.1
  • translate-toolkit: 3.8.6
  • lxml: 4.9.2
  • Pillow: 9.5.0
  • nh3: 0.2.11
  • python-dateutil: 2.8.2
  • social-auth-core: 4.4.2
  • social-auth-app-django: 5.2.0
  • django-crispy-forms: 2.0
  • oauthlib: 3.2.2
  • django-compressor: 4.3.1
  • djangorestframework: 3.14.0
  • django-filter: 23.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.11.0
  • rapidfuzz: 3.0.0
  • openpyxl: 3.1.2
  • celery: 5.2.7
  • django-celery-beat: 2.5.0
  • kombu: 5.2.4
  • translation-finder: 2.15
  • weblate-language-data: 2023.4
  • html2text: 2020.1.16
  • pycairo: 1.23.0
  • pygobject: 3.44.1
  • diff-match-patch: 20200713
  • requests: 2.28.2
  • django-redis: 5.2.0
  • hiredis: 2.2.2
  • sentry_sdk: 1.21.1
  • Cython: 0.29.34
  • misaka: 2.1.1
  • GitPython: 3.1.31
  • borgbackup: 1.2.4
  • pyparsing: 3.0.9
  • pyahocorasick: 2.0.0
  • python-redis-lock: 4.0.0
  • charset-normalizer: 3.1.0
  • Python: 3.11.3
  • Git: 2.30.2
  • psycopg2: 2.9.6
  • psycopg2-binary: 2.9.6
  • phply: 1.2.6
  • ruamel.yaml: 0.17.21
  • tesserocr: 2.6.0
  • boto3: 1.26.124
  • zeep: 4.2.1
  • aeidon: 1.12
  • iniparse: 0.5
  • mysqlclient: 2.1.1
  • Mercurial: 6.4.2
  • git-svn: 2.30.2
  • git-review: 2.3.1
  • Redis server: 7.0.9
  • PostgreSQL server: 15.2
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://:weblate@weblate-redis-master:6379/1, redis://:weblate@weblate-redis-master:6379/1, regular
  • Platform: Linux 5.4.17-2136.313.6.el8uek.x86_64 (x86_64)

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented May 16, 2023

Is the SSH key added to the same user as configured in WEBLATE_GITLAB_TOKEN / WEBLATE_GITLAB_USERNAME?

@timur-st94
Copy link
Author

Yes,  the same user

@nijel
Copy link
Member

nijel commented May 16, 2023

Other things which might be worth checking:

  • Did Weblate actually fork the repository under the user in GitLab?
  • Is not the RSA key attached to a different user in GitLab?
  • Can you check git remotes on Weblate clone of the repo (it lives in /app/data/vcs/PROJECT/COMPONENT)?

@timur-st94
Copy link
Author

  • Do you mean when creating a component? there was an option to specify only ssh url
  • RSA key was removed, rechecked
  • git remotes is user name of GitLab and origin

@nijel
Copy link
Member

nijel commented May 16, 2023

Yes, it depends on a component configuration, see https://docs.weblate.org/en/latest/admin/continuous.html#pushing-changes-from-weblate

@timur-st94
Copy link
Author

Tried to create a component with a fork, could make a merge request. Thanks
But the same doesn't work from branch

@nijel
Copy link
Member

nijel commented May 18, 2023

Maybe I'll explain what should happen:

  1. Uses GitLab API to fork repo (or get existing fork).
  2. Configures this as remote in local repo (with username as name).
  3. Pushes to this repo using SSH URL.

The 3 is what fails here. So either the repository URL is wrong, or the Weblate SSH key does not have access to the forked repository.

@github-actions
Copy link

The issue you have reported is now resolved. If you don’t feel it’s right, please follow its labels to get a clue for further steps.

  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants