Address missing local-provisioner scenario #692
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There have been a few instances of users reporting that they can't run kernels due to the
local-provisioner
not being available. However, this provisioner is registered in the current jupyter_client package, yet when the package searches for the default provisioner (i.e.,local-provisioner
) it is not found.It turns out that in certain circumstances, which remain a mystery to me, there can be multiple dist-info directories present related to
jupyter_client
- one representing the previous release (6.x - which does not include kernel provisioning andlocal-provisioner
) and the current release, which is obviously running since its looking for thelocal-provisioner
. Since entrypoints uses the first distribution it finds, it locates the 6.x dist-info directory and deemslocal-provisioner
as not available.This pull request will detect this condition (i.e.,
local-provisioner
is not available), issue a warning message alerting users to the situation instructing them what to do, but then constructs a local-provisioner entrypoint instance so that default behavior is experienced and kernels can be started.Here's an example of the logged warning:
[W 10:08:17.848 NotebookApp] Kernel Provisioning: The 'local-provisioner' is not found. This is likely due to the presence of multiple jupyter_client distributions and a previous distribution is being used as the source for entrypoints - which does not include 'local-provisioner'. That distribution should be removed such that only the version-appropriate distribution remains (version >= 7). Until then, a 'local-provisioner' entrypoint will be automatically constructed and used.
The candidate distribution locations are: ['/opt/anaconda3/envs/elyra-dev/lib/python3.8/site-packages/jupyter_client-6.1.12.dist-info', '/opt/anaconda3/envs/elyra-dev/lib/python3.8/site-packages/jupyter_client-7.0.2.dist-info']
I think we should treat this as a HOTFIX since it appears to be occurring at a high enough frequency.
If anyone has ideas for what causes a previous distribution to remain, that would be helpful.