Closed ghost closed 3 years ago
Proposed workaround by @waldbauer-certat :
let old_bot = app.nodes[old_id];
if(old_bot != undefined) {
node.parameters.destination_queues = old_bot.parameters.destination_queues;
}
Ah, yeah, whoops. I moved those two lines out of a block below where old_bot
is already confirmed to exist.
After applying the above patch, there are more errors happening after renaming bots.
positions in file are ignored: TypeError: app.positions[node.bot_id] is undefined
convert_nodes http://localhost/intelmq-manager/js/configs.js:303
saveData http://localhost/intelmq-manager/js/configs.js:580
jQuery 6
<anonymous> http://localhost/intelmq-manager/js/configs.js:492
jQuery 2
Object { parameters: {…}, defaults: {}, bot_id: "ecs-expert", name: "ECS", group: "Expert", module: "intelmq.bots.experts.ecs.expert", description: "Write some fields to the output field in ECS format", enabled: true, run_mode: "continuous" }
configs.js:307:25
Uncaught TypeError: can't convert undefined to object
saveData http://localhost/intelmq-manager/js/configs.js:600
jQuery 6
<anonymous> http://localhost/intelmq-manager/js/configs.js:492
jQuery 2
configs.js:600:47
Uncaught TypeError: right-hand side of 'in' should be an object, got undefined
add_edge http://localhost/intelmq-manager/js/network-configuration.js:281
addEdge http://localhost/intelmq-manager/js/network-configuration.js:159
_performAddEdge http://localhost/intelmq-manager/plugins/vis.js/vis.js:51976
_finishConnect http://localhost/intelmq-manager/plugins/vis.js/vis.js:51915
_bindHammer http://localhost/intelmq-manager/plugins/vis.js/vis.js:48239
inputHandler http://localhost/intelmq-manager/plugins/vis.js/vis.js:18566
propagatedHandler http://localhost/intelmq-manager/plugins/vis.js/vis.js:14100
emit http://localhost/intelmq-manager/plugins/vis.js/vis.js:16635
inputHandler http://localhost/intelmq-manager/plugins/vis.js/vis.js:14631
PEhandler http://localhost/intelmq-manager/plugins/vis.js/vis.js:15025
domHandler http://localhost/intelmq-manager/plugins/vis.js/vis.js:14546
addEventListeners http://localhost/intelmq-manager/plugins/vis.js/vis.js:14338
each http://localhost/intelmq-manager/plugins/vis.js/vis.js:14176
addEventListeners http://localhost/intelmq-manager/plugins/vis.js/vis.js:14337
init http://localhost/intelmq-manager/plugins/vis.js/vis.js:14567
Input http://localhost/intelmq-manager/plugins/vis.js/vis.js:14550
PointerEventInput http://localhost/intelmq-manager/plugins/vis.js/vis.js:14984
createInputInstance http://localhost/intelmq-manager/plugins/vis.js/vis.js:14601
Manager http://localhost/intelmq-manager/plugins/vis.js/vis.js:16398
Hammer http://localhost/intelmq-manager/plugins/vis.js/vis.js:16258
PropagatingHammer http://localhost/intelmq-manager/plugins/vis.js/vis.js:13933
_bindHammer http://localhost/intelmq-manager/plugins/vis.js/vis.js:48192
_create http://localhost/intelmq-manager/plugins/vis.js/vis.js:48172
Network http://localhost/intelmq-manager/plugins/vis.js/vis.js:33312
initNetwork http://localhost/intelmq-manager/js/configs.js:769
draw http://localhost/intelmq-manager/js/configs.js:742
load_configuration http://localhost/intelmq-manager/js/runtime.js:84
load_file http://localhost/intelmq-manager/js/runtime.js:60
jQuery 6
authenticatedAjax http://localhost/intelmq-manager/js/static.js:502
authenticatedGetJson http://localhost/intelmq-manager/js/static.js:489
load_file http://localhost/intelmq-manager/js/runtime.js:57
load_configuration http://localhost/intelmq-manager/js/runtime.js:82
load_file http://localhost/intelmq-manager/js/runtime.js:60
jQuery 6
authenticatedAjax http://localhost/intelmq-manager/js/static.js:502
authenticatedGetJson http://localhost/intelmq-manager/js/static.js:489
load_file http://localhost/intelmq-manager/js/runtime.js:57
load_configuration http://localhost/intelmq-manager/js/runtime.js:78
load_bots http://localhost/intelmq-manager/js/configs.js:166
load_file http://localhost/intelmq-manager/js/runtime.js:60
jQuery 6
authenticatedAjax http://localhost/intelmq-manager/js/static.js:502
authenticatedGetJson http://localhost/intelmq-manager/js/static.js:489
load_file http://localhost/intelmq-manager/js/runtime.js:57
<anonymous> http://localhost/intelmq-manager/js/configs.js:948
network-configuration.js:281:17
Phew.
Strange, I don't get any errors when adding new bots after applying the patch.
Right, node.parameters.destination_queues
should be filled in as an empty object on new bots.
node.parameters.destination_queues = old_bot ? old_bot.parameters.destination_queues : {};
Sometimes, but interestingly not always, we get the exception
in the console and can't add new bots. I'm not sure yet, why it happens on some systems, but not on others. I was just able to reproduce it with gbc1991a (maintenance) and with gbb0d6a9 (develop)