kbn_network icon indicating copy to clipboard operation
kbn_network copied to clipboard

Kibana fails to start when using the Network Plugin

Open ankitagarwal10k opened this issue 4 years ago • 8 comments

Hi,

I tried using the Kibana network plugin on my Ubuntu 18 version by downloading the latest version of the network plugin tar.gz file as the Kibana version on my system is 7.6 But when I start the Kibana service - it fails with the below mentioned error in the logs:

**> FATAL Error: Optimizations failure.

ERROR in ./plugins/network_vis/public/network_vis.js Module not found: Error: Can't resolve 'ui/vis/vis_factory' in '/usr/share/kibana/plugins/network_vis/public'

kibana.service: Main process exited, code=exited, status=1/FAILURE kibana.service: Failed with result 'exit-code'. kibana.service: Service hold-off time over, scheduling restart.**

Below is the details of package.json file

**> {

"name": "network_vis", "version": "7.5.2", "kibana": { "version": "kibana" }, "authors": [ "David Moreno Lumbreras [email protected]" ], "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/dlumbrer/kbn_network" }, "dependencies": { "vis-network": "7.2.0", "randomcolor": "0.5.0", "css-element-queries": "0.3.2", "keycharm": "^0.2.0", "moment": "^2.24.0", "vis-data": "^6.2.1", "vis-util": "^1.1.8" } }**

And below is the content in the network_vis.js file

**> import "plugins/network_vis/network_vis.less";

import { KbnNetworkVisController } from './network_vis_controller' import { visFactory } from 'ui/vis/vis_factory'; import { Schemas } from 'ui/vis/editors/default/schemas'; import { setup as visualizations } from '../../../src/legacy/core_plugins/visualizations/public/np_ready/public/legacy'; import image from './images/icon-network.svg'; import networkVisTemplate from 'plugins/network_vis/network_vis.html'; import networkVisParamsTemplate from 'plugins/network_vis/network_vis_params.html'; import { AngularVisController } from 'ui/vis/vis_types/angular_vis_type';

// register the provider with the visTypes registry visualizations.types.registerVisualization(NetworkVisTypeProvider);

// define the TableVisType function NetworkVisTypeProvider(Private) {

// return the visType object, which kibana will use to display and configure new // Vis object of this type. return visFactory.createBaseVisualization({ name: 'network', title: 'Network', image, description: 'Displays a network node that link two fields that have been selected.', visualization: AngularVisController, visConfig: { defaults: { showLabels: true, showPopup: true, showColorLegend: true, nodePhysics: true, firstNodeColor: '#6F86D7', secondNodeColor: '#DAA05D', canvasBackgroundColor: '#FFFFFF', shapeFirstNode: 'dot', shapeSecondNode: 'box', displayArrow: false, posArrow: 'to', shapeArrow: 'arrow', smoothType: 'continuous', scaleArrow: 1, minCutMetricSizeNode: 0, maxNodeSize: 80, minNodeSize: 8, maxEdgeSize: 20, minEdgeSize: 0.1, springConstant: 0.001, gravitationalConstant: -35000, labelColor: '#000000' }, template: networkVisTemplate, }, editorConfig: { optionsTemplate: networkVisParamsTemplate, schemas: new Schemas([ { group: 'metrics', name: 'size_node', title: 'Node Size', mustBeFirst: 'true', min: 1, max: 1, defaults: [ { type: 'count', schema: 'size_node' } ] }, { group: 'metrics', name: 'size_edge', title: 'Edge Size', max: 1, }, { group: 'buckets', name: 'first', icon: 'fa fa-circle-thin', mustBeFirst: 'true', title: 'Node', min: 1, max: 2, aggFilter: ['terms']//Only have sense choose terms }, { group: 'buckets', name: 'second', icon: 'fa fa-random', title: 'Relation', max: 1, aggFilter: ['terms'] }, { group: 'buckets', name: 'colornode', icon: 'fa fa-paint-brush', title: 'Node Color', max: 1, aggFilter: ['terms'] }, { group: 'buckets', name: 'colornode', icon: 'fa fa-paint-brush', title: 'Node Color', max: 1, aggFilter: ['terms'] } ]) }, responseHandlerConfig: { asAggConfigResults: true }, // structures the data tables (returned by kibana in resp and in UI Inspect) hierarchicalData: function (vis) { return true; }, }); }

export default NetworkVisTypeProvider;**

I am unable to get a proper resolution for it from anywhere on the google or the digitalocean website.

Can anyone help me here with this issue ? How can this be resolved and what changes will I have to make?

ankitagarwal10k avatar Mar 06 '20 07:03 ankitagarwal10k

Could you try using the code from the 7-dev branch? thanks!

dlumbrer avatar Mar 06 '20 08:03 dlumbrer

I tried with that as well and still got the same issue. Is there any kind of changes which I am supposed to do in the files? I even tried by the git clone way of installing the plugin but unlucky

ankitagarwal10k avatar Mar 06 '20 08:03 ankitagarwal10k

I've also tried running the 7-dev release (and tried the git clone method) with the same error. Running on Windows 10, Kibana 7.6.0.

FATAL Error: Optimizations failure. 9267 modules ERROR in ./plugins/network_vis/public/network_vis.js Module not found: Error: Can't resolve 'ui/vis/vis_factory' in 'C:\kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\plugins\network_vis\public'

StuartSmith21 avatar Mar 06 '20 15:03 StuartSmith21

Got the same error with docker. ELK_VERSION=7.6.0

ARG ELK_VERSION

# https://www.docker.elastic.co/
FROM docker.elastic.co/kibana/kibana:${ELK_VERSION}

# Add your kibana plugins setup here
RUN curl -L https://github.com/dlumbrer/kbn_network/releases/download/7.5.X-1/network_vis-7.tar.gz | tar xz -C /usr/share/kibana/plugins
FATAL  Error: Optimizations failure.
   9267 modules

    ERROR in ./plugins/network_vis/public/network_vis.js
    Module not found: Error: Can't resolve 'ui/vis/vis_factory' in '/usr/share/kibana/plugins/network_vis/public'

StanGirard avatar Mar 12 '20 16:03 StanGirard

@dlumbrer Any update if we could get a fix for it ? As I have to use it for one of the project requirement and can only be worked with the Network Plugin. Please respond ASAP.

Thanks, Ankit Agarwal

ankitagarwal10k avatar Mar 13 '20 08:03 ankitagarwal10k

Hey @ankitagarwal10k , @StanGirard , @StuartSmith21 , did you get a work around this issue?

Working with a PATCH on #83 fixed it for me. Try this !

robinkiplangat avatar Apr 02 '20 17:04 robinkiplangat

I tried the patch on the windows system but after the checkout step nothing worked for me.

ankitagarwal10k avatar Apr 03 '20 08:04 ankitagarwal10k

It's weird ! May be we can help you with the patch installation. After the checkout step you have to apply the patch with the git command.

Did you have an error with this step ? Could you give us more details ?

pchakour avatar Apr 18 '20 14:04 pchakour