nexus Invalid state: DELETED; allowed: [STARTED] 问题解决

问题

线上nexus因为误操作 blob存储,造成nexus 出现Invalid state: DELETED; allowed: [STARTED],然后就是现有的nexus 也不能使用了(nexus服务异常)
以下是参考的解决方法

解决方法

手工处理相关的blob存储,删除,同时重启nexus服务,但是有一个问题,我们不能删除repo了,主要删除repo就报错,出现上边的问题,解决方法:可以进入
orientdb进行删除相关数据库的配置,需要操作的数据库有config 以及component

数据操作环境准备

注意因为需要使用orientdb 的console,所以修改使用了root账户

  • docker-compose 文件
 
version: "3"
services:
  nexus:
    build: ./
    ports:
    - "8081:8081"

Dockerfile

FROM sonatype/nexus3:3.16.2
USER root
  • 连接命令
    需要进入容器: docker-compose exec nexus sh
    component 数据库操作
 
java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar
connect plocal:/opt/sonatype/sonatype-work/nexus3/db/component admin admin
select *  from bucket;
delete from  bucket where repository_name='<reponame>';

config 数据库操作

java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar
connect plocal:/opt/sonatype/sonatype-work/nexus3/db/config admin admin
select * from repository
delete from repository where @RID=#38:3 // rid 

参考资料

https://orientdb.com/docs/2.2.x/SQL.html
https://orientdb.com/docs/last/console/Console-Modes.html

原文地址:https://www.cnblogs.com/rongfengliang/p/13791587.html