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

git-as-svn service should start after GitLab #313

Open
db4 opened this issue Nov 20, 2019 · 4 comments
Open

git-as-svn service should start after GitLab #313

db4 opened this issue Nov 20, 2019 · 4 comments
Labels

Comments

@db4
Copy link

db4 commented Nov 20, 2019

Otherwise, I get the following on a server reboot:

Nov 13 12:35:20 git git-as-svn[144]: 2019-11-13T12:35:20,108  INFO [main] (Main.java:42) - git-as-svn version: 1.21.7, f6e194fc3c1daf0bb03d14aaa07deb483470dc28
Nov 13 12:35:24 git git-as-svn[144]: 2019-11-13T12:35:24,404  INFO [main] (Log.java:193) - Logging initialized @16972ms to org.eclipse.jetty.util.log.Slf4jLog
Nov 13 12:35:24 git git-as-svn[144]: 2019-11-13T12:35:24,991  INFO [main] (Server.java:370) - jetty-9.4.19.v20190610; built: 2019-06-10T16:30:51.723Z; git: afc
f563148970e98786327af5e07c261fda175d3; jvm 1.8.0_201-b09
Nov 13 12:35:25 git git-as-svn[144]: 2019-11-13T12:35:25,404  INFO [main] (ContextHandler.java:857) - Started o.e.j.s.ServletContextHandler@225129c{/,null,AVAI
LABLE}
Nov 13 12:35:25 git git-as-svn[144]: 2019-11-13T12:35:25,596  INFO [main] (AbstractConnector.java:292) - Started ServerConnector@1890516e{HTTP/1.1,[http/1.1]}{
localhost:8123}
Nov 13 12:35:25 git git-as-svn[144]: 2019-11-13T12:35:25,597  INFO [main] (Server.java:410) - Started @18166ms
Nov 13 12:35:26 git git-as-svn[144]: Exception in thread "main" java.lang.RuntimeException: org.gitlab.api.GitlabAPIException: GitLab is not responding
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:243)
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor$1.hasNext(GitlabHTTPRequestor.java:197)
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor.getAll(GitlabHTTPRequestor.java:165)
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.GitlabAPI.getProjects(GitlabAPI.java:813)
Nov 13 12:35:26 git git-as-svn[144]: at svnserver.ext.gitlab.mapping.GitLabMappingConfig.create(GitLabMappingConfig.java:79)
Nov 13 12:35:26 git git-as-svn[144]: at svnserver.server.SvnServer.<init>(SvnServer.java:149)
Nov 13 12:35:26 git git-as-svn[144]: at svnserver.server.Main.main(Main.java:65)
Nov 13 12:35:26 git git-as-svn[144]: Caused by: org.gitlab.api.GitlabAPIException: GitLab is not responding
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor.handleAPIError(GitlabHTTPRequestor.java:408)
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor.access$300(GitlabHTTPRequestor.java:38)
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:240)
Nov 13 12:35:26 git git-as-svn[144]: ... 6 more
Nov 13 12:35:26 git git-as-svn[144]: Caused by: java.io.IOException: Server returned HTTP response code: 502 for URL: http://xxx.local/api/v4/projects?per_p
age=100
Nov 13 12:35:26 git git-as-svn[144]: at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
Nov 13 12:35:26 git git-as-svn[144]: at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor.parse(GitlabHTTPRequestor.java:363)
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor.access$200(GitlabHTTPRequestor.java:38)
Nov 13 12:35:26 git git-as-svn[144]: at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:236)
Nov 13 12:35:26 git git-as-svn[144]: ... 6 more

And no service until manual restart of git-as-svn.service

@slonopotamus slonopotamus added bug gitlab GitLab integration labels Dec 13, 2019
@AlexanderSemenyak
Copy link

how to configure /init.d/git-as-svn header file for start after gitlab manually?

@slonopotamus
Copy link
Collaborator

It would be great if someone with systemd experience provided a fix for this bug.

@db4
Copy link
Author

db4 commented Dec 23, 2021

The following git-as-svn.service works for me. Not an ideal solution as it doesn't try to detect that the Gitlab startup sequence is completed and just uses a delay, but that's better than nothing.

[Unit]
Description=git-as-svn server
After=network.target syslog.target gitlab-runsvdir.service
ConditionFileNotEmpty=/etc/git-as-svn/git-as-svn.conf

[Service]
User=git
EnvironmentFile=/etc/default/git-as-svn
ExecStart=/usr/bin/git-as-svn --config /etc/git-as-svn/git-as-svn.conf $GAS_ARGS
ExecStartPre=/bin/sleep 180
TimeoutStartSec=240

[Install]
WantedBy=multi-user.target

@hihig2001
Copy link

don't know why, buy above mechanism using After=gitlab-runsvdir.service puts my git-as-svn.service to status enabled but inactive(dead). here my little adjusted one.
by the way my os is ubuntu 22.04 lts

[Unit]
Description=git-as-svn server
After=network.target syslog.target
ConditionFileNotEmpty=/etc/git-as-svn/git-as-svn.conf

[Service]
Type=idle
User=git
EnvironmentFile=/etc/default/git-as-svn
ExecStart=/usr/bin/git-as-svn --config /etc/git-as-svn/git-as-svn.conf $GAS_ARGS
ExecStartPre=/bin/sleep 120
TimeoutStartSec=240

[Install]
WantedBy=multi-user.target

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

No branches or pull requests

4 participants