Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring eureka security Batch update failure with HTTP status code 401

I study spring cloud eureka , cloud and they works finely . But after adding security in eureka service , it met some errors .

All the code and errors details is in https://github.com/keryhu/eureka-security

The eureka service application.yml

security:
  user:
    name: user
    password: password

eureka: 
  client:
    registerWithEureka: false
    fetchRegistry: false
  server:
    wait-time-in-ms-when-sync-empty: 0 

And The config-service application.java

@SpringBootApplication
@EnableConfigServer
@EnableDiscoveryClient

config-service application.yml

eureka:
  client:
    registry-fetch-interval-seconds: 5
    serviceUrl:
       defaultZone: http://user:password@${domain.name:localhost}:8761/eureka/

spring:  
  cloud:
     config:
       server:
         git:
           uri: https://github.com/spring-cloud-samples/config-repo
           basedir: target/config 

There is errors exported after starting the config-service:

2016-04-10 11:22:39.402 ERROR 80526 --- [get_localhost-3] c.n.e.cluster.ReplicationTaskProcessor   : Batch update failure with HTTP status code 401; discarding 1 replication tasks
2016-04-10 11:22:39.402  WARN 80526 --- [get_localhost-3] c.n.eureka.util.batcher.TaskExecutors    : Discarding 1 tasks of TaskBatchingWorker-target_localhost-3 due to permanent error
2016-04-10 11:23:09.411 ERROR 80526 --- [get_localhost-3] c.n.e.cluster.ReplicationTaskProcessor   : Batch update failure with HTTP status code 401; discarding 1 replication tasks
2016-04-10 11:23:09.412  WARN 80526 --- [get_localhost-3] c.n.eureka.util.batcher.TaskExecutors    : Discarding 1 tasks of TaskBatchingWorker-target_localhost-3 due to permanent error
2016-04-10 11:23:39.429 ERROR 80526 --- [get_localhost-3] c.n.e.cluster.ReplicationTaskProcessor   : Batch update failure with HTTP status code 401; discarding 1 replication tasks
2016-04-10 11:23:39.430  WARN 80526 --- [get_localhost-3] c.n.eureka.util.batcher.TaskExecutors    : Discarding 1 tasks of TaskBatchingWorker-target_localhost-3 due to permanent error
like image 969
Kery Hu Avatar asked Apr 10 '16 03:04

Kery Hu


1 Answers

SET eureka.client.serviceUrl.defaultZone of eureka-server http://username:password@localhost:8761/eureka/

like image 53
Jacky Fan Avatar answered Oct 19 '22 05:10

Jacky Fan