-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task Manager fails when inline scripts are disabled #49853
Comments
Pinging @elastic/kibana-stack-services (Team:Stack Services) |
I've put together a simple fix where we identify when this happens and instead of throwing an error, it logs:
This makes messaging better, but doesn't solve the issue that Task Manager will no longer work if inline scripts are disabled. We'll have to have a discussion about whether this is a reasonable situation or not. |
@gmmorris thanks for the fast response on this issue! I only discovered this because I'm working on an unrelated feature that needs to degrade gracefully if inline -or- stored scripts are disabled in Elasticsearch. Since it sounds like we'd have at least 2 consumers of this information, I wonder if it'd make sense to have a common service that plugins can use to get this information up-front, instead of parsing an error message after the fact. @/jasontedor mentioned that we can use the interface NodeSettingsResponse {
nodes?: {
[nodeId: string]: {
settings: {
script: {
allowed_types?: string[];
allowed_contexts?: string[];
};
};
};
};
}
const nodeScriptSettings: NodeSettingsResponse = await clusterClient.callAsInternalUser(
'transport.request',
{
method: 'GET',
path: '/_nodes/settings?filter_path=nodes.*.settings.script',
}
);
const usingDefaultScriptSettings = !nodeScriptSettings.nodes;
const canUseStoredScripts =
usingDefaultScriptSettings ||
Object.values(nodeScriptSettings.nodes!).some(node => {
const allowedTypes = node.settings.script.allowed_types;
return !allowedTypes || allowedTypes.includes('stored');
});
const canUseInlineScripts =
usingDefaultScriptSettings ||
Object.values(nodeScriptSettings.nodes!).some(node => {
const allowedTypes = node.settings.script.allowed_types;
return !allowedTypes || allowedTypes.includes('inline');
}); What do you think? |
Hmm, that's interesting. I'll try and get that PR merged today so we at least have better messaging around it. |
Regarding |
Yep, I agree we shouldn't ask each plugin to make this call -- In the legacy platform, the I could see us introducing either a rather specific |
A sync discussion raised a couple of ideas to address this properly:
Further discussion is needed. |
I've merged the improved messaging, but keeping this issue open as TM will still be disabled from 7.5 onwards if the user disables inline scripts |
This is still an open question what we should do in this case. Should we add documentation for this limitation? |
From conversations with @kobelb a while ago, I think as long as Kibana doesn't crash, we're ok. |
The prior thinking is that Kibana has not been explicit about needing scripting to be enabled in Elasticsearch. However, various features in Kibana have become dependent on scripting being enabled. Additionally, we haven't had any reports from users about this causing issues. Therefore, during 7.x we should ensure that Kibana continues to generally work when scripting is disabled in Elasticsearch, but we're comfortable with some features not working. Starting in 8.0, we should explicitly document that scripting must be enabled in Elasticsearch and we're comfortable with Kibana failing in a fiery ball of glory when scripting is disabled. |
It's worth verifying that TM doesn't keep polling when it encounters this error. |
For 7.x: Docs, ensure we're not spamming the console, ensure we're not crashing Kibana. |
Summary of the things to fix:
|
Kibana version: Noticed on 7.5, probably earlier as well
When inline scripts are disabled in Elasticsearch (docs), Kibana's task manager repeatedly logs the following error:
Expected Behavior
The Task Manager should ideally be able to function without inline (or stored) scripts. If that is not possible, then the task manager should probably fail more gracefully instead of polluting the logs. If scripts are a hard requirement for Task Manager to function, then we should at least document it as such.
The text was updated successfully, but these errors were encountered: