Graylog2 / Graylog2/graylog2-server
Production server crashes if node-id is unable to be found
- Dominant language
- Java
- Stars
- 8.1k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 217
Description
## Expected Behavior
The server should provide some type of useful logging and message to inform the user that the `node-id` was unable to be found
## Current Behavior
If the node-id is unable to be found, it crashes with no real information.
```
✗ java -jar graylog.jar server -f ./server.conf
2021-03-11 16:09:41,777 WARN : org.graylog2.shared.security.tls.DefaultTLSProtocolProvider - JRE doesn't support all default TLS protocols. Changing <[TLSv1.2, TLSv1.3]> to <[TLSv1.2]>
2021-03-11 16:09:41,961 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: AWS plugins 4.1.0-SNAPSHOT [org.graylog.aws.AWSPlugin]
2021-03-11 16:09:41,961 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Enterprise Integrations 4.1.0-SNAPSHOT [org.graylog.enterprise.integrations.EnterpriseIntegrationsPlugin]
2021-03-11 16:09:41,962 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Integrations 4.1.0-SNAPSHOT [org.graylog.integrations.IntegrationsPlugin]
2021-03-11 16:09:41,963 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Collector 4.1.0-SNAPSHOT [org.graylog.plugins.collector.CollectorPlugin]
2021-03-11 16:09:41,963 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Graylog Enterprise 4.1.0-SNAPSHOT [org.graylog.plugins.enterprise.EnterprisePlugin]
2021-03-11 16:09:41,964 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Graylog Enterprise (ES6 Support) 4.1.0-SNAPSHOT [org.graylog.plugins.enterprise.org.graylog.plugins.enterprise.es6.EnterpriseES6Plugin]
2021-03-11 16:09:41,964 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Graylog Enterprise (ES7 Support) 4.1.0-SNAPSHOT [org.graylog.plugins.enterprise.org.graylog.plugins.enterprise.es7.EnterpriseES7Plugin]
2021-03-11 16:09:41,965 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Threat Intelligence Plugin 4.1.0-SNAPSHOT [org.graylog.plugins.threatintel.ThreatIntelPlugin]
2021-03-11 16:09:41,965 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Elasticsearch 6 Support 4.1.0-SNAPSHOT+ae0ea25 [org.graylog.storage.elasticsearch6.Elasticsearch6Plugin]
2021-03-11 16:09:41,965 INFO : org.graylog2.bootstrap.CmdLineTool - Loaded plugin: Elasticsearch 7 Support 4.1.0-SNAPSHOT+ae0ea25 [org.graylog.storage.elasticsearch7.Elasticsearch7Plugin]
Exception in thread "main" java.lang.NullPointerException
at org.graylog2.Configuration$NodeIdFileValidator.validate(Configuration.java:359)
at org.graylog2.Configuration$NodeIdFileValidator.validate(Configuration.java:348)
at com.github.joschi.jadconfig.JadConfig.validateParameter(JadConfig.java:215)
at com.github.joschi.jadconfig.JadConfig.processClassFields(JadConfig.java:148)
at com.github.joschi.jadconfig.JadConfig.process(JadConfig.java:99)
at org.graylog2.bootstrap.CmdLineTool.processConfiguration(CmdLineTool.java:353)
at org.graylog2.bootstrap.CmdLineTool.readConfiguration(CmdLineTool.java:346)
at org.graylog2.bootstrap.CmdLineTool.run(CmdLineTool.java:180)
at org.graylog2.bootstrap.Main.main(Main.java:50)
```
## Possible Solution
Provide an output to the user to inform them that `node-id` was unable to be created/read
## Steps to Reproduce (for bugs)
1. Setup server.conf to use a node-id in the same directory
- `node_id_file = node-id`
2. java -jar graylog.jar server -f ./server.conf
3. Crashes
4. Update server.conf
- `node_id_file = /tmp/node-id`
5. It works!
Contributor guide
Assessment
This issue has not been assessed yet.