fluvio
fluvio copied to clipboard
[Bug]: fvm switch fails on some systems with running local cluster
What happened
fvm switch
in a docker container failed with "Error: Text file busy (os error 26)"
Expected behavior
fvm switch
or fvm update
successfully switches versions
Describe the setup Running fluvio and fvm switch on some os environments with a running cluster can lead to this error.
- Macos: this behavior does not occur
- docker: this bug occurs
- linux: this bug can occur
How to reproduce it (as minimally and precisely as possible)
- Install fvm & fluvio
-
fvm install latest
-
fluvio cluster start
Starts a local cluster -
fvm switch stable
Causes an "Error: Text file busy (os error 26)"
Additional context A workaround is to shut down the local fluvio cluster, switch versions, then restart. An intermediate fix is to detect running instances and ask them to shutdown.
Dockerfile for refernce:
FROM ubuntu:20.04
ENV TERM linux
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y curl unzip
WORKDIR /fluvio
RUN curl -fsS https://hub.infinyon.cloud/install/install.sh | bash
RUN echo 'source "${HOME}/.fvm/env"' >> ~/.bashrc
CMD ["/bin/bash"]
## Instruction
##
## >> Build and Run Dockerfile
## docker build --tag fluvio .
## docker run --name fluvio -d fluvio sleep infinity
##
## >> Login into the container
## docker exec -ti fluvio bash
Stale issue message
For linux, probably need to std:fs::remove_file
to cause an unlink first on binaries in the .flvuio/bin
directory, then copy new versions in.
see https://stackoverflow.com/questions/16764946/what-generates-the-text-file-busy-message-in-unix
Fix tested and worked on Linux and within a linux docker env.