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

Installing pfsense-restapi causes "pfSense-upgrade -d -c" to throw a warning #588

Closed
mbentley opened this issue Oct 30, 2024 · 4 comments · Fixed by #596
Closed

Installing pfsense-restapi causes "pfSense-upgrade -d -c" to throw a warning #588

mbentley opened this issue Oct 30, 2024 · 4 comments · Fixed by #596
Labels
bug Something isn't working troubleshooting Issues that are troubleshooting requests or need troubleshooting before proceeding

Comments

@mbentley
Copy link

Describe the bug
After installing pfsense-restapi, it causes pfSense-upgrade -d -c to throw a warning:

[2.7.2-RELEASE][[email protected]]/root: pfSense-upgrade -d -c
pfSense-repoc-static: si_get_packages: failed to run the pkg info command: /usr/local/sbin/pkg-static info -R --raw-format json-compact pfSense-pkg-\* 2>&1
pfSense-repoc-static: no pfSense packages installed
>>> Updating repositories metadata...
Updating pfSense-core repository catalogue...
Fetching meta.conf:
Fetching packagesite.pkg:
pfSense-core repository is up to date.
Updating pfSense repository catalogue...
Fetching meta.conf:
Fetching packagesite.pkg:
pfSense repository is up to date.
All repositories are up to date.
Your system is up to date

This is also present in the UI when looking at the System Update screen:

Before installed:
screenshot 2024-10-30 at 9 43 26 AM

After installed:
screenshot 2024-10-30 at 9 43 48 AM

Here is the output of /usr/local/sbin/pkg-static info -R --raw-format json-compact pfSense-pkg-\* which it complains about:
post.json

I can only guess that maybe there is something that pfSense is not expecting when parsing the output. From what I see from a Netgate forum post, this is just a cosmetic issue and doesn't actually cause any problems but I thought I would report it in case it does eventually cause any issues.

To Reproduce
Steps to reproduce the behavior:

  1. Start with a clean pfsense install
  2. Install the v2 package for pfsense-restapi
  3. Check the System Update screen; also visible from the CLI running pfSense-upgrade -d -c
  4. See error

Expected behavior
I wouldn't expect this to happen. The v1 pfsense-api package doesn't cause this behavior. Unsure of what is happening when the v2 package is installed.

Screenshots or Response
If applicable, add screenshots or response data to help explain your problem.

pfSense Version & Package Version:

  • pfSense Version: pfSense 2.7.2
  • Package Version: pfsense-restapi 2.2_1

Affected Endpoints:

n/a

Additional context
Add any other context about the problem here.

@mbentley
Copy link
Author

I tested all of the v2 versions and the error/warning doesn't happen on all versions from 2.2.0 to 2.1.3 but it does start with 2.2.0 and above.

@jaredhendrickson13
Copy link
Owner

Thanks for reporting! I see the same behavior, but I don't see any significant difference between the output of v2.1.3 and v2.2.0 from the command it's complaining about /usr/local/sbin/pkg-static info -R --raw-format json-compact pfSense-pkg-\*. Running that command succeeds on both and only the size, directories and files have changed in the output; which is expected between builds: pkginfo-v213-v221.json

This will be a little hard to debug because pfSense-repoc is a compiled tool and the source for it does not appear to be open sourced. I'm sure it's looking for something specific in the output of that command, but it's not very apparent what that would be. I'll try to carve out some time this week to work backwards from v2.2.0 and see which commit specificaly introduced the issue.

@jaredhendrickson13 jaredhendrickson13 added bug Something isn't working troubleshooting Issues that are troubleshooting requests or need troubleshooting before proceeding labels Oct 30, 2024
@jaredhendrickson13
Copy link
Owner

I believe I found the issue. pfSense-repoc only complains when a package contains more than a certain number of files. Maybe it's expecting the output of /usr/local/sbin/pkg-static info -R --raw-format json-compact pfSense-pkg-\* to be within some arbitrary character limit per package, I'm not completely sure. But that warning does go away when I make a build with less files, and it doesn't make a difference which files are cut.

For now, I can update the build process to exclude tests from the package in releases since those don't serve any functional purpose beyond development. That should give a little more wiggle room for a while. I'll need to find a better long term solution however.

@mbentley
Copy link
Author

Oh interesting findings, thanks for digging into it further so quickly! That forum thread mentioned that they might have addressed what they called a cosmetic issue in a yet to be released patch (mentioned near the end of the thread) so maybe they addressed the limit, assuming that’s indeed it.

@jaredhendrickson13 jaredhendrickson13 linked a pull request Nov 9, 2024 that will 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 troubleshooting Issues that are troubleshooting requests or need troubleshooting before proceeding
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants