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

Infinite app instance spawns on macOS #921

Open
srudolph-credera opened this issue Feb 21, 2024 · 12 comments
Open

Infinite app instance spawns on macOS #921

srudolph-credera opened this issue Feb 21, 2024 · 12 comments
Labels
help wanted Extra attention is needed kind/bug macos

Comments

@srudolph-credera
Copy link

What happened?

I opened the DevPod application and it started spawning a new DevPod application every second or so without quitting the previous instance(s). I could only stop the process by quitting faster than the new windows could open.

What did you expect to happen instead?

I expected only a single DevPod instance to start.

How can we reproduce the bug? (as minimally and precisely as possible)

Since I took no other action other than opening the application, the issue must either be universal or tied to something about my particular setup/environment. Here's what I've already done to eliminate some environment differences (with no change in the app behavior):

  • I deleted DevPod.app and redownloaded it
  • I removed my entire ~/.devpod directory and restarted

Local Environment:

  • DevPod Version: v0.5.3
  • Operating System: mac
  • ARCH of the OS: ARM64

DevPod Provider:
N/A

Anything else we need to know?

I first installed DevPod yesterday and was using it without issue. I shutdown my laptop yesterday and started experiencing the issue the first time I opened DevPod this morning.

Peculiarities of my setup that might be relevant:

  • I installed DevPod to ~/Applications instead of /Applications
  • I am not on an admin user account
  • I manually added DevPod's CLI to my zshell PATH environment variable at $HOME/Applications/DevPod.app/Contents/MacOS
@pascalbreuninger
Copy link
Member

Hey @srudolph-credera , thanks for opening the issue. This has been reported a couple of times by now and I am just not able to reproduce it :/ I've tried to setup a non-admin user and install DevPod into the $HOME/Applications folder. Works just fine

Are there any other pointers that could be relevant here?

@srudolph-credera
Copy link
Author

Thanks for taking a look at this! One thing you might try is coming back to that non-admin user account after a shutdown or a day has passed - DevPod worked fine for me initially as well.

As for other potential distinctions, I'm on a very recently setup M3 Max MacBook Pro for what it's worth - which has the upside I suppose of limiting how much cruft is around that could impact this (I did not use Migration Assistant). It's also a corporate machine, which could mean all sorts of typical enterprise software and configurations are around.

This has been a good opportunity for me to learn the DevPod CLI and thankfully I'm able to use that without issue, so it's just the GUI app here. I'd be happy to try running a debug version of the GUI (or launching it with an existing debug flag) if that's helpful!

@pascalbreuninger
Copy link
Member

Thanks for the info! I'll leave my test user sitting and will try again tomorrow.
If it still isn't reproducible I will have to look into things you'd typically lock down in enterprise macs :D

@pascalbreuninger
Copy link
Member

Quick update @srudolph-credera: I've tried to wait a couple of days but wasn't able to repro. I'd appreciate any input on how exactly your machine is locked down

@srudolph-credera
Copy link
Author

I'm limited in what I can disclose that would be helpful (like the particular applications), but I believe the bulk of the lockdown is network related and I'd be happy to test specific things if you have something in particular that you think might be causing trouble.

This may be unrelated, but I do see a report of infinite window spawn in Tauri, could be an upstream issue: tauri-apps/tauri#7681.

I also did a quick scan through the code - I'm completely new to Rust and to this project, but at first glance it looks like there is a new_main method that spans a new instance and there's an event handler that at least theoretically could be the cause of additional calls to that method:

let _ = self.window_helper.new_main(self.app_name.clone());
.

@pascalbreuninger
Copy link
Member

pascalbreuninger commented Mar 5, 2024

Thanks for looking deeper into this!
Tried to repro with firewall settings enabled but still no luck. Anyway, the rust method is definitely a possible source of this problem, let's try to work around it and then cut a new prerelease so you can verify

see #944

@srudolph-credera
Copy link
Author

I'll be happy to test it!

@pascalbreuninger
Copy link
Member

New release over here, you'd need to install it manually though. Hope it works 🤞

@srudolph-credera
Copy link
Author

I just tested DevPod_macos_aarch64.app.tar.gz and unfortunately I see the same spawning issue. I was able to capture DevPod.log for you and this is what it looks like:

[2024-03-05][15:30:55][INFO][devpod_desktop] Setup application
[2024-03-05][15:30:55][INFO][devpod_desktop] Setup done
[2024-03-05][15:30:55][INFO][devpod_desktop] Run
[2024-03-05][15:30:55][INFO][devpod_desktop::server] Listening on 127.0.0.1:25842
[2024-03-05][15:30:56][INFO][devpod_desktop] Setup application
[2024-03-05][15:30:56][INFO][devpod_desktop] Setup done
[2024-03-05][15:30:56][INFO][devpod_desktop] Run
[2024-03-05][15:30:56][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:30:57][INFO][devpod_desktop] Setup application
[2024-03-05][15:30:57][INFO][devpod_desktop] Setup done
[2024-03-05][15:30:57][INFO][devpod_desktop] Run
[2024-03-05][15:30:57][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:30:57][INFO][devpod_desktop] Setup application
[2024-03-05][15:30:57][INFO][devpod_desktop] Setup done
[2024-03-05][15:30:57][INFO][devpod_desktop] Run
[2024-03-05][15:30:57][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:30:58][INFO][devpod_desktop] Setup application
[2024-03-05][15:30:58][INFO][devpod_desktop] Setup done
[2024-03-05][15:30:58][INFO][devpod_desktop] Run
[2024-03-05][15:30:58][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:30:59][INFO][devpod_desktop] Setup application
[2024-03-05][15:30:59][INFO][devpod_desktop] Setup done
[2024-03-05][15:30:59][INFO][devpod_desktop] Run
[2024-03-05][15:30:59][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:30:59][INFO][devpod_desktop] Setup application
[2024-03-05][15:30:59][INFO][devpod_desktop] Setup done
[2024-03-05][15:30:59][INFO][devpod_desktop] Run
[2024-03-05][15:30:59][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:31:00][INFO][devpod_desktop] Setup application
[2024-03-05][15:31:00][INFO][devpod_desktop] Setup done
[2024-03-05][15:31:00][INFO][devpod_desktop] Run
[2024-03-05][15:31:00][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:31:01][INFO][devpod_desktop] Setup application
[2024-03-05][15:31:01][INFO][devpod_desktop] Setup done
[2024-03-05][15:31:01][INFO][devpod_desktop] Run
[2024-03-05][15:31:01][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:31:01][INFO][devpod_desktop] Setup application
[2024-03-05][15:31:01][INFO][devpod_desktop] Setup done
[2024-03-05][15:31:01][INFO][devpod_desktop] Run
[2024-03-05][15:31:01][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)
[2024-03-05][15:31:01][INFO][devpod_desktop] Setup application
[2024-03-05][15:31:01][INFO][devpod_desktop] Setup done
[2024-03-05][15:31:01][INFO][devpod_desktop] Run
[2024-03-05][15:31:01][ERROR][devpod_desktop] Failed to start server: Address already in use (os error 48)

@pascalbreuninger
Copy link
Member

hm okay, thanks @srudolph-credera. This looks like the setup process is being called time and time again... Not really sure why though, maybe it's really a tauri bug

@srudolph-credera
Copy link
Author

I tried building DevPod locally and ran into issues doing so within Multipass, but if you are able to make a build that logs the event/message passed into handle_msg plus any diagnostic info about Tauri's state, I'd be happy to run it!

@srudolph-credera
Copy link
Author

srudolph-credera commented Mar 6, 2024

Another possibility mentioned in tauri-apps/tauri#7681 is this Tauri plugin: https://github.com/tauri-apps/plugins-workspace/tree/v1/plugins/single-instance.

Edit: nevermind, macOS isn't supported by that plugin - tauri-apps/plugins-workspace#287.

@pascalbreuninger pascalbreuninger added the help wanted Extra attention is needed label Apr 18, 2024
@89luca89 89luca89 added the macos label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed kind/bug macos
Projects
None yet
Development

No branches or pull requests

3 participants