habitat
habitat copied to clipboard
Can't restart service when "non utf8" files in pkg_config_path
Hello,
Just had a weird one... hab svc start my/service
did absolutely nothing. No errors, no starting of services, just, exit 0 without starting my service.
Basically I think what happened was I had a file open with VIM, rebooted the machine without closing the file, which created a .file.swp
in the pkg_config_path
directory and wouldn't allow it to start.
Performing a unload/load of the service generated the error:
hab-sup(MR): Unable to start ja/artifactory-pro, hab-sup(CF)[components/sup/src/manager/service/config.rs:492:40]: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }, ".db.properties.swp")
Steps to reproduce
- Install a package
- In the packages directory, create a vim swap file (or any other non-utf8 file, I'm guessing a binary file would work?)
- Stop a running service
- Attempt to start the service
- Attempt to start the service three more times
- Observe lack of error messages when attempting to restart service
Recommendation
I think the following two things would make the overall user experience better:
- provide a full path to the offending file. I just so happened to recognize the file name as a vim swap file and just so happened to recognize the file, so was able to quickly narrow it down and find the offending file (I guess a
find / -name <filename>
would have worked too). But if this was some generated file name it may be more challenging to find in the future. - If the supervisor can't start a loaded service generate an error message! It's not always easy to unload/load a service and if that's the only time an error message is generated you're left with services not starting and no reason as to why.
I might even go a step further and say habitat should ignore any binary files in the config directory... but then I might also question why are there binary files in the config directory, and wouldn't we want to call that out as possibly wrong? E.g.: if you have a binary file in your config directory when building the package a "hey, can't build this package because of binary file in config dir" might be more appropriate than including it...
Anyway, just wanted to get this recorded while it was fresh, thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.
Was this resolved?
On Thu, Apr 2, 2020 at 6:11 PM stale[bot] [email protected] wrote:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/habitat-sh/habitat/issues/5784#issuecomment-608158770, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSBHCM5JHHFB2QINTH6IMDRKUSRHANCNFSM4F626DXQ .
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.
This issue has been automatically closed after being stale for 400 days. We still value your input and contribution. Please re-open the issue if desired and leave a comment with details.