[halo-dev/halo]halo开发环境启动,初始化报错

2024-03-20 937 views
7
是什么版本出现了此问题?

2.8.0

使用的什么数据库?

H2

使用的哪种方式部署?

Jar

  1. 使用idea启动halo服务,profile设置为win,dev
  2. 访问localhost:8090/console,填入信息 3.首次console登录后出现 image
  3. 再次console登录后出现 image

回答

9

可以复现,应该是没有下载预设插件导致获取预设插件接口异常导致的,你可以清理掉开发环境工作目录(~/halo2-dev),然后先执行:

 ./gradlew downloadPluginPresets

然后再启动。

@halo-dev/sig-docs 需要修改一下开发环境构建和运行的文档。

5

@JohnNiang 如果没有下载预设插件的情况下,使用 dev 配置运行时,访问 /apis/api.console.halo.run/v1alpha1/plugin-presets 接口异常是符合预期的吗?

9

收到,感谢协助

7

@ruibaby 求助,我在使用./gradlew.bat downloadPluginPresets下载预设插件之后再运行出现了以下两个报错,我的环境和上述作者的一样。

  2023-08-16T17:15:53.185+08:00 ERROR 15960 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter    : [7246d40f-585] 500 Server Error for HTTP POST "/apis/api.console.halo.run/v1alpha1/plugins/install"

  java.lang.IllegalArgumentException: `detail` is required
      at org.springframework.util.Assert.notNull(Assert.java:204) ~[spring-core-6.0.11.jar:6.0.11]
      at org.springframework.web.DefaultErrorResponseBuilder.<init>(DefaultErrorResponseBuilder.java:57) ~[spring-web-6.0.11.jar:6.0.11]
      at org.springframework.web.ErrorResponse.builder(ErrorResponse.java:177) ~[spring-web-6.0.11.jar:6.0.11]
      at run.halo.app.infra.exception.Exceptions.createErrorResponse(Exceptions.java:59) ~[main/:na]
      at run.halo.app.infra.exception.handlers.ProblemDetailErrorAttributes.getErrorAttributes(ProblemDetailErrorAttributes.java:35) ~[main/:na]
      at org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler.getErrorAttributes(AbstractErrorWebExceptionHandler.java:146) ~[spring-boot-autoconfigure-3.1.2.jar:3.1.2]
      at run.halo.app.infra.exception.handlers.HaloErrorWebExceptionHandler.renderErrorResponse(HaloErrorWebExceptionHandler.java:55) ~[main/:na]
      at org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler.lambda$handle$0(AbstractErrorWebExceptionHandler.java:303) ~[spring-boot-autoconfigure-3.1.2.jar:3.1.2]
      at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:132) ~[reactor-core-3.5.8.jar:3.5.8]
      at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74) ~[reactor-core-3.5.8.jar:3.5.8]
      at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.5.8.jar:3.5.8]
      at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201) ~[reactor-core-3.5.8.jar:3.5.8]
      at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2545) ~[reactor-core-3.5.8.jar:3.5.8]
      at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onSubscribe(FluxConcatArray.java:193) ~[reactor-core-3.5.8.jar:3.5.8]
      at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55) ~[reactor-core-3.5.8.jar:3.5.8]
      at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.8.jar:3.5.8]
      at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.8.jar:3.5.8]

然后下载的四个预设插件出现了以下同样的报错

    2023-08-16T17:15:53.281+08:00 ERROR 15960 --- [nReconciler-t-1] r.h.a.e.controller.DefaultController     : Reconciler in run.halo.app.core.extension.reconciler.PluginReconciler-worker-1 aborted with an error, re-enqueuing...
    java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:\Users\86189\halo2-dev\plugins/PluginFeed-1.1.1.jar
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) ~[na:na]
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) ~[na:na]
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) ~[na:na]
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) ~[na:na]
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232) ~[na:na]
        at java.base/java.nio.file.Path.of(Path.java:147) ~[na:na]
        at java.base/java.nio.file.Paths.get(Paths.java:69) ~[na:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.determinePluginLocation(PluginReconciler.java:736) ~[main/:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.lambda$ensurePluginLoaded$19(PluginReconciler.java:617) ~[main/:na]
        at java.base/java.util.Optional.ifPresent(Optional.java:178) ~[na:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.ensurePluginLoaded(PluginReconciler.java:612) ~[main/:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.getPluginWrapper(PluginReconciler.java:350) ~[main/:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.lookupPluginSetting(PluginReconciler.java:175) ~[main/:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.waitForSettingCreation(PluginReconciler.java:214) ~[main/:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.lambda$readinessDetection$3(PluginReconciler.java:137) ~[main/:na]
        at java.base/java.util.Optional.map(Optional.java:260) ~[na:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.readinessDetection(PluginReconciler.java:136) ~[main/:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.lambda$reconcile$0(PluginReconciler.java:101) ~[main/:na]
        at java.base/java.util.Optional.map(Optional.java:260) ~[na:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.reconcile(PluginReconciler.java:93) ~[main/:na]
        at run.halo.app.core.extension.reconciler.PluginReconciler.reconcile(PluginReconciler.java:75) ~[main/:na]
        at run.halo.app.extension.controller.DefaultController$Worker.run(DefaultController.java:163) ~[main/:na]
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
        at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]