【问题标题】:spring-cloud-config server - org.springframework.cloud.config.server.environment.NoSuchRepositoryException | Cannot clone or checkout repository:?spring-cloud-config 服务器-org.springframework.cloud.config.server.environment.NoSuchRepositoryException |无法克隆或签出存储库:?
【发布时间】:2018-06-14 10:04:09
【问题描述】:

我正在使用 Spring Cloud,并使用 Config-server 来外部化微服务的属性。

下面是配置服务器的清单文件

server:
  port: 8888

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/Girdhars/config-server.git
  application:
    name: config-server

management:
  security:
    enabled: false

但是在访问 Rest Endpoint http://localhost:8888/application/default 我正在低于异常。

{
    "timestamp": 1515082055134,
    "status": 404,
    "error": "Not Found",
    "exception": "org.springframework.cloud.config.server.environment.NoSuchRepositoryException",
    "message": "Cannot clone or checkout repository: https://github.com/Girdhars/config-server.git",
    "path": "/application/default"
}

【问题讨论】:

  • 从网址中删除.git
  • @spencergibb ,它(.git)真的没关系我确实删除了。但不工作
  • 您是否正在通过 http 代理?是这样的吗?

标签: spring spring-boot spring-cloud spring-cloud-config


【解决方案1】:

您的配置中的存储库指向https://github.com/Girdhars/config-server.git,但在浏览器中导航后我收到301 Moved permanently 并被重定向到https://github.com/rathore-girdharsingh/config-server

所以我认为您的问题与此重定向有关。我发现this StackOverflow answer 说:

有了这个更改:https://git.eclipse.org/r/#/c/46261/,它于 2017 年 2 月合并,JGit 应该能够遵循 HTTP 301 状态代码(永久移动)。

顺便说一句,我做了一个快速检查 - 您的配置现在正在使用新版本的 Spring Cloud (Finchley.RELEASE) 和 Spring Boot (2.0.3.RELEASE)

【讨论】:

    猜你喜欢
    • 2018-10-11
    • 1970-01-01
    • 2017-02-19
    • 1970-01-01
    • 2019-02-17
    • 1970-01-01
    • 2019-12-16
    • 2020-09-02
    • 1970-01-01
    相关资源
    最近更新 更多