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

Crash on flexo startup #20

Closed
adam-the opened this issue Jul 11, 2020 · 5 comments
Closed

Crash on flexo startup #20

adam-the opened this issue Jul 11, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@adam-the
Copy link

adam-the commented Jul 11, 2020

Everything has been working brilliantly for the past few weeks, but upon attempting an update today I've realised the service has not been running and is currently crashing on startup. I don't recall making any changes to flexo.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: Empty }', src/mirror_flexo.rs:213:25
stack backtrace:
   0:     0x55f9aaf03455 - <unknown>

Please let me know if you need any more info and thank you for your help.

@nroi nroi added the bug Something isn't working label Jul 12, 2020
nroi added a commit that referenced this issue Jul 12, 2020
@nroi
Copy link
Owner

nroi commented Jul 12, 2020

The error occurs when flexo tries to read extended file attributes from files in /var/cache/flexo/pkg, so maybe it's not something that has changed with flexo, but something that has changed on your file system. Apparently, one of your files has the user.content_length value set to a value that cannot be parsed to a String. I have released a new version that does not immediately crash when the file attributes cannot be parsed. Could you please do the following to help me troubleshoot this further:

  1. Install the most recent version of flexo.
  2. Open the journal (journalctl -f --unit=flexo)
  3. Restart flexo and look at the journal for a log entry like the following:
    File "/var/cache/flexo/pkg/community/os/x86_64/yarn-1.21.0-1-any.pkg.tar.xz" has user.content_length set to value <VALUE>: Unable to convert this value to String: ParseIntError { kind: InvalidDigit }
    

It would be interesting to see what exactly VALUE is in your case.

Thanks!

@adam-the
Copy link
Author

adam-the commented Jul 12, 2020

I'm now getting 50 of this error, all with the same message and value. I was then able to use flexo without any further issues.

File "/var/cache/flexo/pkg/community/os/x86_64/electron7-7.1.14-6-x86_64.pkg.tar.zst" has user.content_length set to value "": Unable to convert this value to String: ParseIntError { kind: Empty }

Again please let me know if there is anything else I can do.
Thank you for your help.

@nroi
Copy link
Owner

nroi commented Jul 12, 2020

That's odd, I don't understand why this problem appeared out of nowhere. Did you change the location of the cached packages? Did you recreate the file system where the cached packages are located? What file system are you using? Flexo requires extended attributes, but they are supported by pretty much all important file systems.

As a workaround, please try the following:

  • Install core/attr if you haven't done so already.
  • Stop the flexo service.
  • Run the following command: sudo find /var/cache/flexo/pkg -type f -exec setfattr -x user.content_length {} \+.
    This will remove the user.content_length extended attribute from all files.
  • Restart the flexo service.

If all goes well, flexo should not report any errors when restarted.

@adam-the
Copy link
Author

adam-the commented Jul 12, 2020

Yep, no errors now. Very peculiar.
I did run the command you gave me before stopping flexo, and upon restarting it I got these messages:

Unable to set extended file attributes for "/var/cache/flexo/pkg/core/os/x86_64/gnupg-2.2.21-1-x86_64.pkg.tar.zst": Os { code: 13, kind: PermissionDenied, message: "Permission denied" }. Please make sure that flexo has write permissions for this file.

But upon restarting again there are no further errors.

I haven't touched the cache or filesystem since I setup the server a few weeks ago. Could it be due to the system crashing? I had one crash the other day due to an unstable overclock, but I definitely wasn't downloading anything at the time.
My file system is ZFS (on root), xattr is on by default and currently enabled.

@nroi
Copy link
Owner

nroi commented Jul 12, 2020

If you still get permission errors, use chown -R so that flexo has write access to all files in /var/cache/flexo.

I'm glad the issue is gone for now, but I'm still puzzled as to what exactly has happened. Apparently, the user.content_length attribute was set to the empty string or some other value that cannot be converted to UTF-8. Flexo doesn't do that.

ZFS is considered stable, and I would not expect a stable file system to write gibberish because of a system crash. But it's still possible.

Anyway, thank you for reporting this and helping me to troubleshoot this issue. I'll make a few more changes to improve flexo's error handling so that it can handle messed up extended attribute values and then close this issue.

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