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

deb package install fails if /usr/bin/watchexec already exists #233

Closed
ngirard opened this issue Jan 19, 2022 · 11 comments
Closed

deb package install fails if /usr/bin/watchexec already exists #233

ngirard opened this issue Jan 19, 2022 · 11 comments
Labels
has workaround Bug has a workaround, so it might not need urgent attention need repro Needs a reproduction and some investigation OS: Linux Affects Linux specifically question Less of an issue and more of a question
Milestone

Comments

@ngirard
Copy link

ngirard commented Jan 19, 2022

Using Watchexec 1.15.1, then 1.18.0 on Ubuntu 21.10.

I stumbled upon this error message when running the following command, which used to work fine:

watchexec -p -w ~/Obsidian -e md -i './at/' "just handle_md"
Error: I/O error: Bad file descriptor (os error 9)

Updated from v1.15.1 to v1.18.0 to no avail.
Suggested RUST_LOG=1 didn't help.
Adding --verbose to invocation didn't help either.
Trying to increase verbosity as offered by latest release using -vvv failed with

error: The argument '--verbose' was provided more than once, but cannot be used multiple times

I'm not feeling lucky today !
Any thoughts ?

Cheers

@passcod
Copy link
Member

passcod commented Jan 19, 2022

If --verbose didn't give you a lot of output and -vvv didn't work I'm inclined to think you didn't actually upgrade to 1.18. Can you provide:

  • output of watchexec --version
  • logging output from --verbose
  • how you installed 1.18
  • the error message you get on 1.18 (the format changed a bit, so it wouldn't show up as you gave)

@ngirard
Copy link
Author

ngirard commented Jan 19, 2022

I'm inclined to think you didn't actually upgrade to 1.18

As a matter of fact, you're right !
I didn't pay much attention to the output of dpkg -i when performing the upgrade, and it turns out that it had failed:

LANG=C sudo dpkg -i watchexec-1.18.0-x86_64-unknown-linux-gnu.deb
(Reading database ... 524320 files and directories currently installed.)
Preparing to unpack watchexec-1.18.0-x86_64-unknown-linux-gnu.deb ...
Unpacking watchexec-cli (1.18.0) ...
dpkg: error processing archive watchexec-1.18.0-x86_64-unknown-linux-gnu.deb (--install):
 trying to overwrite '/usr/bin/watchexec', which is also in package watchexec 1.15.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 watchexec-1.18.0-x86_64-unknown-linux-gnu.deb

@passcod
Copy link
Member

passcod commented Jan 19, 2022

Guess you need to uninstall the old one first, I'll make a note in the release.

@ngirard
Copy link
Author

ngirard commented Jan 19, 2022

@ngirard
Copy link
Author

ngirard commented Jan 19, 2022

After proper upgrading, I'm left with:

[[Native watcher failed to instantiate: Too many open files (os error 24)]]

The initial problem is gone though.
I'll rename this issue to match the package upgrade problem. Feel free to close it whenever you want.

@ngirard ngirard changed the title I/O error: Bad file descriptor (os error 9) deb package install fails if /usr/bin/watchexec already exists Jan 19, 2022
@passcod
Copy link
Member

passcod commented Jan 19, 2022

That's probably the same underlying cause. Something to do with this? https://watchexec.github.io/docs/inotify-limits.html or other ulimits

@ngirard
Copy link
Author

ngirard commented Jan 19, 2022

Yeah, I should check that. I already bumped that value years ago, I guess it was reset after a system upgrade.

Thanks for your feedback !

@ngirard
Copy link
Author

ngirard commented Jan 19, 2022

That's probably the same underlying cause. Something to do with this? https://watchexec.github.io/docs/inotify-limits.html or other ulimits

There might be another problem.
After doing

echo 1000000 | sudo tee /proc/sys/fs/inotify/max_user_watches

(1,000,000)
I'm still getting the same error message:

[[Native watcher failed to instantiate: Too many open files (os error 24)]]

whereas the number of files to watch is just

find . -type f -name '*.md'|wc -l
4179

I should perhaps open a new issue for this ?

@passcod
Copy link
Member

passcod commented Jan 20, 2022

Given the error code it's likely to be one of these two:

   EMFILE The per-process limit on the number of open file
          descriptors has been reached.

   ENFILE The system-wide limit on the total number of open files
          has been reached.

(from the inotify_init(2) manpage)

So you'll need to check your system ulimits. Maybe try rebooting in the first instance?

@passcod passcod added need repro Needs a reproduction and some investigation OS: Linux Affects Linux specifically question Less of an issue and more of a question has workaround Bug has a workaround, so it might not need urgent attention labels Jan 21, 2022
@passcod passcod added this to the 1.18 issues milestone Jan 26, 2022
@ngirard
Copy link
Author

ngirard commented Jan 28, 2022

I'm about to file a new issue related to the Too many open files error.

This issue is now only about the deb package installation.

@ngirard
Copy link
Author

ngirard commented Jan 28, 2022

I could upgrade flawlessly from v0.18.0 to v0.18.4 using the deb package, so it seems like this issue can be closed as well !

@passcod passcod closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has workaround Bug has a workaround, so it might not need urgent attention need repro Needs a reproduction and some investigation OS: Linux Affects Linux specifically question Less of an issue and more of a question
Projects
None yet
Development

No branches or pull requests

2 participants