fluvio icon indicating copy to clipboard operation
fluvio copied to clipboard

[Bug]: fvm switch fails on some systems with running local cluster

Open digikata opened this issue 1 year ago • 3 comments

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)

  1. Install fvm & fluvio
  2. fvm install latest
  3. fluvio cluster start Starts a local cluster
  4. 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.

digikata avatar Dec 08 '23 01:12 digikata

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 

digikata avatar Dec 08 '23 01:12 digikata

Stale issue message

github-actions[bot] avatar Feb 06 '24 11:02 github-actions[bot]

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

digikata avatar Feb 16 '24 20:02 digikata

Fix tested and worked on Linux and within a linux docker env.

digikata avatar Mar 22 '24 00:03 digikata