Uninstalling x-pack plugin from Kibana Docker image (5.6.1) broken: Unable to remove plugin because of error: "ENOTEMPTY: directory not empty, rmdir '/usr/share/kibana/plugins/x-pack/.phantom'"


#1

Relates to this GitHub issue (now closed).

Opening a thread here at the suggestion of kobelb, who closed the original GitHub issue. I can confirm, though, that the problem is present as of the latest available Kibana Docker image.

Copying my comment from that thread here:


Running into this same issue with docker.elastic.co/kibana/kibana:5.6.1.

[user@server]$ docker run --user root -ti --rm docker.elastic.co/kibana/kibana:5.6.1 bash
[root@70ac29ce9a7e kibana]# bin/kibana-plugin remove x-pack
Removing x-pack...
Unable to remove plugin because of error: "ENOTEMPTY: directory not empty, rmdir '/usr/share/kibana/plugins/x-pack/.phantom'" 
[root@70ac29ce9a7e kibana]# rm -rf /usr/share/kibana/plugins/x-pack/.phantom    
rm: cannot remove '/usr/share/kibana/plugins/x-pack/.phantom': Directory not empty
[root@70ac29ce9a7e kibana]# ls /usr/share/kibana/plugins/x-pack/.phantom -l
ls: cannot access /usr/share/kibana/plugins/x-pack/.phantom/phantomjs-2.1.1-linux-i686.tar.bz2: No such file or directory
ls: cannot access /usr/share/kibana/plugins/x-pack/.phantom/phantomjs-2.1.1-linux-x86_64.tar.bz2: No such file or directory
ls: cannot access /usr/share/kibana/plugins/x-pack/.phantom/phantomjs-2.1.1-macosx.zip: No such file or directory
ls: cannot access /usr/share/kibana/plugins/x-pack/.phantom/phantomjs-2.1.1-windows.zip: No such file or directory
total 0
?????????? ? ? ? ?            ? phantomjs-2.1.1-linux-i686.tar.bz2
?????????? ? ? ? ?            ? phantomjs-2.1.1-linux-x86_64.tar.bz2
?????????? ? ? ? ?            ? phantomjs-2.1.1-macosx.zip
?????????? ? ? ? ?            ? phantomjs-2.1.1-windows.zip
[root@70ac29ce9a7e kibana]# rm -f /usr/share/kibana/plugins/x-pack/.phantom/*
[root@70ac29ce9a7e kibana]# ls /usr/share/kibana/plugins/x-pack/.phantom -l
ls: cannot access /usr/share/kibana/plugins/x-pack/.phantom/phantomjs-2.1.1-linux-i686.tar.bz2: No such file or directory
ls: cannot access /usr/share/kibana/plugins/x-pack/.phantom/phantomjs-2.1.1-linux-x86_64.tar.bz2: No such file or directory
ls: cannot access /usr/share/kibana/plugins/x-pack/.phantom/phantomjs-2.1.1-macosx.zip: No such file or directory
ls: cannot access /usr/share/kibana/plugins/x-pack/.phantom/phantomjs-2.1.1-windows.zip: No such file or directory
total 0
?????????? ? ? ? ?            ? phantomjs-2.1.1-linux-i686.tar.bz2
?????????? ? ? ? ?            ? phantomjs-2.1.1-linux-x86_64.tar.bz2
?????????? ? ? ? ?            ? phantomjs-2.1.1-macosx.zip
?????????? ? ? ? ?            ? phantomjs-2.1.1-windows.zip

No amount of trying will let me remove these files, so the uninstall command for x-pack (bin/kibana-plugin remove x-pack) appears to be straight up broken in the latest official Kibana docker image.


(Joe Fleming) #2

Strange... I know that phantom is unpacked into that path, maybe the remove command isn't doing a deep remove of the path? I suspect it's a bug in the plugin installer, but let me dig into this a little bit.

UPDATE: It looks like the plugin uninstaller just does a deep path removal, so I'm not sure why the .phantom path wouldn't be empty. Is it possible that the instance was still running while you tried to uninstall the plugin? I'm thinking maybe the phantom instance was running, so it couldn't be removed, and then the path was not empty as a result of that... just a wild guess though.


(Dallas Toth) #3

even if you get xpack removed from the docker container I still recieve an error plugin:elasticsearch@5.6.1 | [remote_transport_exception] [tiebreaker-0000000014][111.111.111.111:19672][indices:admin/mapping/put] when you try to login. My other 5.4.2 docker containers that never had xpack installed are still fine. ES is not red.


(Joe Fleming) #4

Did you remove xpack from the Elasticsearch container as well? Or at least disable Security? If you still have security on, that could be what is preventing Kibana's es plugin from working correctly. The error message makes me think that's not actually the issue, but it seemed worth asking.


(Dallas Toth) #5

This is resolved for me. The issue for me was that my kibana index's were missing some mappings.


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.