Skip to content
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

Starting two instances at the same time can cause cloning of extensions repo to fail #6244

Open
cmeury opened this issue Oct 10, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@cmeury
Copy link

cmeury commented Oct 10, 2023

Expected Behavior

It is not immediately clear what the expectation should be; maybe the extensions repository could be cloned with a separate command, so the user can control the timing? Or some sort of simple locking mechanism (empty file in ~/local/share/tilt-dev))?

Current Behavior

Using a Tiltfile which loads extensions, starting two instance of Tilt can result in conflicts about cloning the extensions repository:

Tilt started on http://localhost:10350/
v0.32.4, built 2023-05-24
Serving embedded Tilt production web assets

Initial Build
Loading Tiltfile at: /home/cmeury/tmp/tilt-instance-test/Tiltfile
# cd .; git clone -- https://github.com/tilt-dev/tilt-extensions /home/cmeury/.local/share/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions
Cloning into '/home/cmeury/.local/share/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions'...
error: Untracked working tree file '.circleci/Dockerfile' would be overwritten by merge.
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

ERROR: extensionrepo default: download error: waiting 5s before retrying. Original error: exit status 128
ERROR: Traceback (most recent call last):
  /home/cmeury/tmp/tilt-instance-test/Tiltfile:1:1: in <toplevel>
Error: cannot load ext://secret: loading extension repo default: download error: waiting 5s before retrying. Original error: exit status 128

Steps to Reproduce

  1. Create a Tiltfile with a single entry: load('ext://secret', 'secret_from_dict')
  2. Run two instances of Tilt at the same time
    tilt up --debug --port 10350 > first.log &
    tilt up --debug --port 20350 > second.log &  
    
  3. Check the log files for errors

Context

tilt doctor Output

Tilt: v0.32.4, built 2023-05-24
System: linux-amd64

About Your Use Case

Running two Tilt instances at the same time on CI; for separate environments.

@cmeury cmeury added the bug Something isn't working label Oct 10, 2023
@cmeury cmeury changed the title Starting two instances a tht Starting two instances at the same time can cause cloning of extensions repo to fail Oct 10, 2023
@nicks
Copy link
Member

nicks commented Oct 10, 2023

good catch! ya, we should probably have some sort of file-based lock here 🤔

@nicks
Copy link
Member

nicks commented Oct 10, 2023

i've also been wondering if we should change the behavior slightly. rather than doing a git pull on every tilt up, maybe it should pin to the version of the extensions repo that came out when that version of tilt was released.

@cmeury
Copy link
Author

cmeury commented Oct 11, 2023

@nicks That's also what we did in our workaround, just before starting the two instances:

git clone --depth 1 --branch v0.32.4 -- https://github.com/tilt-dev/tilt-extensions ~/.local/share/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants