创建Gitlab容器后重新启动Jenkins容器

exdqitrt  于 2023-04-05  发布在  Jenkins
关注(0)|答案(1)|浏览(162)

这是我的docker-compose文件:

version: '3'
services:
  remote_host:
    container_name: remote-host
    image: remote-host
    build:
      context: centos7
    networks:
      - net
  jenkins:
    container_name: jenkins
    image: jenkins-blueocean
    ports:
      - "8081:8080"
    build:
      context: .
    volumes:
      - "$PWD/jenkins_home:/var/jenkins_home"
    restart: on-failure
    networks:
      - net
  git:
    container_name: git-server
    image: 'gitlab/gitlab-ee:latest'
    hostname: 'gitlab.example.com'
    ports:
      - '8091:80'
    volumes:
      - '$GITLAB_HOME/config:/etc/gitlab'
      - '$GITLAB_HOME/logs:/var/log/gitlab'
      - '$GITLAB_HOME/data:/var/opt/gitlab'
    networks:
      - net

networks:
  net:

所有容器都成功启动并运行,但当我登录到Jenkins UI时,相应的容器崩溃了。
如果我停止Gitlab容器,我就不会面临这个问题。
我使用这些命令来运行容器:

export GITLAB_HOME=$HOME/gitlab
docker-compose up -d

我在Jenkins日志中看到的唯一错误如下

at java.base/java.lang.Thread.run(Thread.java:829)
2023-03-26 14:23:36 Caused by: java.lang.AssertionError: class hudson.security.csrf.DefaultCrumbIssuer is missing its descriptor
2023-03-26 14:23:36     at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1634)
2023-03-26 14:23:36     at hudson.security.csrf.CrumbIssuer.getDescriptor(CrumbIssuer.java:141)
2023-03-26 14:23:36     at hudson.Functions.getCrumbRequestField(Functions.java:1997)
2023-03-26 14:23:36     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2023-03-26 14:23:36     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2023-03-26 14:23:36     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2023-03-26 14:23:36     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2023-03-26 14:23:36     at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
2023-03-26 14:23:36     at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
2023-03-26 14:23:36     at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
2023-03-26 14:23:36     at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
2023-03-26 14:23:36     at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
2023-03-26 14:23:36     at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
2023-03-26 14:23:36     at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:76)
2023-03-26 14:23:36     at org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61)
2023-03-26 14:23:36     at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsString(ExpressionSupport.java:46)
2023-03-26 14:23:36     at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.buildAttributes(ReallyStaticTagLibrary.java:113)
2023-03-26 14:23:36     at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:97)
2023-03-26 14:23:36     at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
2023-03-26 14:23:36     at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:101)
2023-03-26 14:23:36     at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
2023-03-26 14:23:36     at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:101)
2023-03-26 14:23:36     at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
2023-03-26 14:23:36     at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:265)
2023-03-26 14:23:36     ... 58 more
2023-03-26 14:23:36 Caused: javax.servlet.ServletException
2023-03-26 14:23:36     at org.kohsuke.stapler.Facet$1.dispatch(Facet.java:249)
2023-03-26 14:23:36     at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
2023-03-26 14:23:36     at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
2023-03-26 14:23:36     at org.kohsuke.stapler.Stapler.invoke(Stapler.java:690)
2023-03-26 14:23:36     at hudson.init.impl.InstallUncaughtExceptionHandler.handleException(InstallUncaughtExceptionHandler.java:59)
2023-03-26 14:23:36     at hudson.init.impl.InstallUncaughtExceptionHandler.lambda$init$0(InstallUncaughtExceptionHandler.java:33)
2023-03-26 14:23:36     at org.kohsuke.stapler.compression.CompressionFilter.reportException(CompressionFilter.java:72)
2023-03-26 14:23:36     at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:56)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
2023-03-26 14:23:36     at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:86)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
2023-03-26 14:23:36     at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
2023-03-26 14:23:36     at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:38)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
2023-03-26 14:23:36     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
2023-03-26 14:23:36     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
2023-03-26 14:23:36     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:549)
2023-03-26 14:23:36     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
2023-03-26 14:23:36     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
2023-03-26 14:23:36     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1571)
2023-03-26 14:23:36     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
2023-03-26 14:23:36     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1383)
2023-03-26 14:23:36     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
zsohkypk

zsohkypk1#

由于内存不足,它被杀死了。我检查了被杀死的容器,发现退出代码137。

"State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": true,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 137,
            "Error": "",
            "StartedAt": "2023-03-29T10:26:03.135664452Z",
            "FinishedAt": "2023-03-29T10:28:49.133673682Z"
        }

GitLab容器似乎消耗了更多的内存,增加了Docker资源的负担。
所以我在Docker桌面中将内存从4GB增加到8GB。

相关问题