zoukankan      html  css  js  c++  java
  • 解决nexus仓库只能拉取不能推送的问题

    当时正在使用jenkins自动构造镜像推送到nexus上的docker镜像仓库,突然间就报错如下,没法推送,超过重试次数后也是没法推送:

    ERROR: Build step failed with exception
    com.github.dockerjava.api.exception.DockerClientException: Could not push image: received unexpected HTTP status: 500 Server Error
    	at com.github.dockerjava.core.command.PushImageResultCallback.throwFirstError(PushImageResultCallback.java:40)
    	at com.github.dockerjava.core.async.ResultCallbackTemplate.awaitCompletion(ResultCallbackTemplate.java:94)
    	at com.github.dockerjava.core.command.PushImageResultCallback.awaitSuccess(PushImageResultCallback.java:53)
    	at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$Run.pushImages(DockerBuilderPublisher.java:433)
    	at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$Run.run(DockerBuilderPublisher.java:330)
    	at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher.perform(DockerBuilderPublisher.java:463)
    	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:112)
    	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
    	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
    	at hudson.model.Build$BuildExecution.build(Build.java:206)
    	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
    	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
    	at hudson.model.Run.execute(Run.java:1880)
    	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    	at hudson.model.ResourceController.execute(ResourceController.java:97)
    	at hudson.model.Executor.run(Executor.java:428)
    Build step 'Build / Publish Docker Image' marked build as failure
    Finished: FAILURE
    

    登录到nexus中进行查看,其中发现有一个错误信息:给其中一个仓库进行 rebulid index 时报错: A database error occurred

    通过查看nexus日志:

    2019-07-17 14:16:24,076+0800 ERROR [FelixStartLevel] *SYSTEM com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage - Exception `4DF5EBB7` in storage `plocal:/opt/nexus/sonatype-work/nexus3/db/config`: 2.2.36 (build d3beb772c02098ceaea89779a7afd4b7305d3788, branch 2.2.x)
    com.orientechnologies.orient.core.exception.OLowDiskSpaceException: Error occurred while executing a write operation to database 'config' due to limited free space on the disk (3152 MB). The database is now working in read-only mode. Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. The minimal required space is 4096 MB. Required space is now set to 4096MB (you can change it by setting parameter storage.diskCache.diskFreeSpaceLimit) .
    	DB name="config"
    	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.checkLowDiskSpaceRequestsAndReadOnlyConditions(OAbstractPaginatedStorage.java:5073)
    	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:1729)
    	at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:541)
    	at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:99)
    	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2908)
    	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2870)
    	at org.sonatype.nexus.orient.transaction.OrientTransaction.commit(OrientTransaction.java:70)
    	at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:67)
    	at org.sonatype.nexus.transaction.Operations.transactional(Operations.java:200)
    	at org.sonatype.nexus.transaction.Operations.call(Operations.java:146)
    	at org.sonatype.nexus.orient.transaction.OrientOperations.call(OrientOperations.java:56)
    	at org.sonatype.nexus.quartz.internal.orient.JobStoreImpl.execute(JobStoreImpl.java:202)
    	at org.sonatype.nexus.quartz.internal.orient.JobStoreImpl.storeJobAndTrigger(JobStoreImpl.java:514)
    	at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:855)
    

    通过查看日志,提示的是磁盘空间不足造成的,至少需要4096 MB的空间,现在只有3152 MB,找到原因后就好处理了
    第一种办法是增加磁盘剩余空间,或者清除一些垃圾数据,释放一些磁盘空间
    第二种办法是设置storage.diskCache.diskFreeSpaceLimit变量
    这种方式的设置地点为:{nexue安装目录}/bin/nexus.vmoptions,

    -Dstorage.diskCache.diskFreeSpaceLimit=2048
    

    然后再重新给仓库rebulid index,推送docker镜像

  • 相关阅读:
    AngularJS $http模块POST请求
    thinkphp整合系列之融云即时通讯在线聊天
    Linux 常用命令
    Linux Shell脚本编写规范、例子
    Linux crontab定时执行任务 命令格式与详细例子
    Linux目录详细说明大全, 方便你以后合理规划及管理
    Linux 操作MySQL常用命令行
    SVN服务器搭建和使用(三)
    Linux下的SVN服务器搭建
    python 根据染色体起始终止点坐标来获取碱基序列
  • 原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/13202952.html
Copyright © 2011-2022 走看看