Spring Cloud Services (SCS) config-server dashboard returns "There was an unexpected error (type=Internal Server Error, status=500)."
search cancel

Spring Cloud Services (SCS) config-server dashboard returns "There was an unexpected error (type=Internal Server Error, status=500)."

book

Article ID: 297108

calendar_today

Updated On:

Products

Support Only for Spring

Issue/Introduction

In Spring Cloud Services (SCS) 3.0 and above, the config-server instance shows status: create succeeded. However, the config-server dashboard returns the following error when accessing it's dashboard: 
There was an unexpected error (type=Internal Server Error, status=500)


Resolution

The problem is mostly caused by improper property settings such as label.

To identify the root cause, please follow the following steps:
 

1. The backend app of config-server service instance is not accessible via cf logs in user space. If not yet installed, please install the Service Instance Logging cf CLI plugin

2. Execute cf service-logs config-server.

3. Replicate the dashboard access problem. 

4. Review the above log output and check if there is a NullPointerException or NoSuchLabelException error:
2021-04-30T12:23:23.39+0200 [APP/PROC/WEB/config-server 0] OUT [http-nio-8080-exec-6] DEBUG o.s.web.servlet.DispatcherServlet.logResult - Failed to complete request: org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: master
2021-04-30T12:23:23.40+0200 [APP/PROC/WEB/config-server 0] OUT [http-nio-8080-exec-6] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet].log - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: master] with root cause​​​

   2021-04-26T11:15:11.66+0100 [APP/PROC/WEB/0] OUT [35m[http-nio-8080-exec-9][0;39m [1;31mERROR[0;39m o.a.c.c.C.[.[.[.[dispatcherServlet].log - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
   2021-04-26T11:15:11.66+0100 [APP/PROC/WEB/0] OUT java.lang.NullPointerException: null
   2021-04-26T11:15:11.66+0100 [APP/PROC/WEB/0] OUT  at io.pivotal.spring.cloud.configserver.git.GitRepositoriesService.snapshotRepository(GitRepositoriesService.java:66)


In Spring Cloud Service (SCS) 3.0 and above, if the git repository label is not specified, "master" will be used as the default label. However, the "master" label is not guaranteed to exist in the repository.


The config-server will hit the above problem if:
 

  • The developer specifies wrong label.
  • The developer doesn't specify label and the "master" label does not exist.

The resolution is to specify the correct "label" property when creating or updating the config-server instance. 

cf cs -c '{"git":{"uri":"https://github.com/SOME_ORG/SOME_REPO", "label": "SOME_LABEL"}}' p.config-server standard config-server