smortex / freebsd-ports

FreeBSD ports tree (read-only mirror)
https://www.FreeBSD.org/ports
Other
0 stars 0 forks source link

opensearch-dashbords logging is broken #5

Open smortex opened 3 years ago

smortex commented 3 years ago

Nothing is added to /var/log/opensearch_dashboards.log when the daemon run.

smortex commented 3 years ago

This seems to be caused by the version of node used:

https://stackoverflow.com/questions/62742307/unable-to-start-kibana

Passing --no-warnings to node(1) allow the service to start but disable all logging (it is what the rc script currently does).

Steps to reproduce the failure when starting without this option and full backtrace:

root@os:/ # sudo -u www NODE_ENV=production node /usr/local/www/opensearch-dashboards/src/cli/dist serve --config /usr/local/etc/opensearch-dashboards/opensearch_dashboards.yml
Unhandled Promise rejection detected:

TypeError: Cannot set property 'writecb' of undefined
    at LogInterceptor.Transform._write (internal/streams/transform.js:185:14)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at LogInterceptor.Writable.write (internal/streams/writable.js:303:10)
    at Monitor.push (/usr/local/www/opensearch-dashboards/node_modules/@elastic/good/lib/monitor.js:207:30)
    at Monitor._logHandler (/usr/local/www/opensearch-dashboards/node_modules/@elastic/good/lib/monitor.js:40:18)
    at module.exports.internals.Podium.internals.Podium.emit (/usr/local/www/opensearch-dashboards/node_modules/podium/lib/index.js:220:49)
    at LegacyLoggingServer.log (/usr/local/www/opensearch-dashboards/src/core/server/legacy/logging/legacy_logging_server.js:111:17)
    at LegacyAppender.append (/usr/local/www/opensearch-dashboards/src/core/server/legacy/logging/appenders/legacy_appender.js:38:24)
    at BaseLogger.log (/usr/local/www/opensearch-dashboards/src/core/server/logging/logger.js:85:16)
    at BaseLogger.info (/usr/local/www/opensearch-dashboards/src/core/server/logging/logger.js:64:10)
    at LoggerAdapter.info (/usr/local/www/opensearch-dashboards/src/core/server/logging/logger_adapter.js:68:17)
    at PluginsService.handleDiscoveredPlugins (/usr/local/www/opensearch-dashboards/src/core/server/plugins/plugins_service.js:183:18)
    at PluginsService.discover (/usr/local/www/opensearch-dashboards/src/core/server/plugins/plugins_service.js:59:5)
    at Server.setup (/usr/local/www/opensearch-dashboards/src/core/server/server.js:165:9)
    at Root.setup (/usr/local/www/opensearch-dashboards/src/core/server/root/index.js:44:14)
    at bootstrap (/usr/local/www/opensearch-dashboards/src/core/server/bootstrap.js:129:5)

Terminating process...
root@os:/ # sudo -u www NODE_ENV=production node --no-warnings /usr/local/www/opensearch-dashboards/src/cli/dist serve --config /usr/local/etc/opensearch-dashboards/opensearch_dashboards.yml

If someone who loves JS is around, they can help fixing this issue directly with upstream :wink:

Related upstream issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/406