WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.56k stars 1.01k forks source link

Push Request on GitLab and an error #3515

Closed liminspace closed 4 years ago

liminspace commented 4 years ago

I try to do create a Push Request on GitLab, but I can't find the button about it and when I use Push button, I get an error.

I am not sure that I set up everything properly, but there is no steps about it in the documentation. I created a user on Gitlab for Weblate, created an Access Token with scope api, added this token into options (docker env):

WEBLATE_GITLAB_USERNAME=Weblate
WEBLATE_GITLAB_HOST=https://gitlab.***.com
WEBLATE_GITLAB_TOKEN=**token*here**

Generated SSH key in Weblate and put it for this user on GitLab. Added used with developer permission for the project in GitLab.

Added a component with CVS GitLab. Set Source code repository and Repository push URL with git@gitlab.***.com:projectname/subgroup/backend.git Translated some phrases, pressed Commit. Pressed Push (because there isn't any mention about Push Requests) and as result got the error:

2020/02/22 21:50:44 fork.go:55: POST https://gitlab.***.com/api/v4/projects/6/fork: 409 {message: {namespace: [is not valid]}}
 (1)

Could someone tell me what I did incorrect? I read the documentation a lot of times, but I still can't understand why I get this error, what I should fix and how to create a Pull Request into GitLab.

Weblate: 3.11.2 Gitlab: 12.8.0

nijel commented 4 years ago

Can the user on GitLab create forks?

In general the error recovery for GitLab and GitHub merge requests is poor with currently used cli tools, it should be reimplemented, see https://github.com/WeblateOrg/weblate/issues/3493

liminspace commented 4 years ago

Added permission to fork, but get a new error:

2020/02/24 11:59:08 fork.go:30: remote: weblate already exists
 (1)
nijel commented 4 years ago

It looks like the lab logic here is simple and once it failed you end up with repo it can not configure: https://github.com/zaquestion/lab/blob/master/cmd/fork.go#L30

You can probably fix this by removing weblate remote in the repository inside Weblate.

liminspace commented 4 years ago

Removed the weblate remote from git repo on weblate and removed fork for Weblate user on Gitlab. Then pressed Push and got the error:

fatal: 'Weblate' does not appear to be a git repository
fatal: Could not read from remote repository.

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

Note, that Weblate gitlab's user is a developer of the project, has SSH-key from Weblate and also has Access Token with api scope which is set up in WEBLATE_GITLAB_* env vars.

Can't find log file with all exception and additional information. Does it exist somewhere?

nijel commented 4 years ago

In case you're using docker, it's logged on it's output. You can get more detailed error reports by using Sentry or Rollbar, see https://docs.weblate.org/en/latest/admin/install.html#collecting-error-reports

liminspace commented 4 years ago

Changed WEBLATE_GITLAB_USERNAME from Weblate to weblate and it started working. @nijel thanks!

github-actions[bot] commented 4 years ago

The issue you have reported seems to be resolved now.