Exception: Failed to build bookie server should include more end user applicable information for problem diagnosis.
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
**Is your enhancement request related to a problem? Please describe.**
The enhancement is related to a problem. I encountered an issue that gives an unhelpful exception and could not find the root cause, only other issues raised where the cause was not clearly stated. The exception that is raised "Failed to build bookie server" should be converted to friendly English so that when it happens, a person know what the nature of the issue is. The following is the exception that is received:
`2022-05-10T21:35:08,852+0000 [main] ERROR org.apache.bookkeeper.server.Main - Failed to build bookie server
org.apache.bookkeeper.bookie.BookieException$InvalidCookieException: instanceId ab9f4d95-da71-4c08-a027-3b6f4fc1df05 is not matching with c438162c-83bb-445f-95e0-6f8e1b0a5d70
at org.apache.bookkeeper.bookie.Cookie.verifyInternal(Cookie.java:142) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.bookie.Cookie.verify(Cookie.java:147) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.bookie.Bookie.verifyAndGetMissingDirs(Bookie.java:395) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.bookie.Bookie.checkEnvironmentWithStorageExpansion(Bookie.java:458) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.bookie.Bookie.checkEnvironment(Bookie.java:273) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.bookie.Bookie.(Bookie.java:731) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.proto.BookieServer.newBookie(BookieServer.java:152) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.proto.BookieServer.(BookieServer.java:120) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.server.service.BookieService.(BookieService.java:52) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.server.Main.buildBookieServer(Main.java:304) ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.server.Main.doMain(Main.java:226) [org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
at org.apache.bookkeeper.server.Main.main(Main.java:208) [org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]`
Unfortunately, this only tell me that there is some sort of mismatch, but not where the mismatched items come from.
**Describe the solution you'd like**
I would like an error that indicates what the issue is at the level of a user of the program, not at the level of the programmer. The above issue should state where those ids are from. Are they from data stored in the zookeeper, on on disk ledger or broker data. I have no idea and yet this issue is arising from some sort of invalid configuration of the software.
**Describe alternatives you've considered**
The aternative is looking all over trying to find out the meaning from various other issues that have been raised.
**Additional context**
Contributor guide
Research direction
Start with Cookie.java at verifyInternal and follow the reported call path through Bookie.java to Main.java. Determine which sources the two instance IDs represent, then make the startup error identify those sources in user-facing language; verify the resulting diagnostic with the relevant existing tests, if present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100