finch icon indicating copy to clipboard operation
finch copied to clipboard

I get an error when starting the VM.

Open ghost opened this issue 2 years ago • 7 comments

Describe the bug When I run finch vm start I get the following error:

FATA[0044] failed to update the user's .profile file: failed to read config file: file does not exist

But exists .profile file.

$ ls -la ~/ | grep profile
-rw-r--r--    1 mymac  staff      0 May 13 21:53 .profile

Steps to reproduce finch vm start

Expected behavior The vm boot completes without any errors.

Screenshots or logs

INFO[0000] Starting existing Finch virtual machine...
INFO[0044] Finch virtual machine started successfully
FATA[0044] failed to update the user's .profile file: failed to read config file: file does not exist

Additional context

  • My mac

macOS Monterey ver 12.3.1 Intel Core i7

  • How i installed finch

brew install finch --cask

To help debug the issue as quickly as possible, we recommend generating a support bundle with finch support-bundle-generate and attaching it to this issue. This packages all Finch-related configs and logs into one file.

ghost avatar May 14 '23 04:05 ghost

Hi @north-hoshi, I checked the .profile permission and it is the same with mine. Could you help run finch support-bundle-generate and attaching it to this issue? Meanwhile, could you please try finch vm stop, finch vm remove, and finch vm init to see if it helps unblock?

KevinLiAWS avatar May 15 '23 18:05 KevinLiAWS

@north-hoshi What is the USER env variable set to on your machine? Finch uses this variable to write to .bashrc inside the VM and if the user running finch does not have this variable set on his machine or it's different to the user running the finch process, it's possible to see this error. Can you try export USER=<user running finch> and they try finch vm start. Thanks!

vsiravar avatar Jun 07 '23 17:06 vsiravar

Hey @vsiravar having the same issue. I can confirm that the USER environment variable is set and I also installed finch via Homebrew. Thanks!

Screenshot 2023-08-16 at 10 32 57 am

strongishllama avatar Aug 16 '23 00:08 strongishllama

@strongishllama Thanks for trying finch! Is this(68825) the same user as the one running the finch process? Finch updates the finch user's .bashrc file in the finch vm post vm initialization. If this is the case can you try running finch as 68825 or run

export USER=`whoami`

vsiravar avatar Aug 16 '23 21:08 vsiravar

@vsiravar Looks like the issue might be on my end. I tried it on another laptop and it worked fine. I'll keep digging for a solution on my end, cheers! 😄

strongishllama avatar Aug 26 '23 03:08 strongishllama

The support-bundle command above is incorrect. It should be finch support-bundle generate.

I'm getting this error when running either finch vm init or finch vm start. My $USER has an @ character in it; could this cause the error?

neil-greenwood avatar Nov 10 '23 09:11 neil-greenwood

@KevinLiAWS Hi, I also encountered the same error and submitted a PR to correct it. I would appreciate it if you could confirm this. https://github.com/runfinch/finch/pull/712

The cause is that the username in the VM will fall back to lima if the host username does not match the lima regular expression. The full path of .bashrc could be /home/lima.linux/.bashrc. ref: https://github.com/lima-vm/lima/blob/a8c703bf8b66d213d00542ef68271cd7b73612ef/pkg/osutil/user.go#L114-L119

w-haibara avatar Nov 30 '23 15:11 w-haibara

Resolved by #712

pendo324 avatar Aug 27 '24 15:08 pendo324