Open FranzMari opened 5 months ago
Is there a workaround for this? I'm running into the same problem.
Sure, apply the aforementioned fix over there: https://github.com/YunoHost/yunohost/blob/dd394e94dc2bc4582a2471f7fe90106713189110/src/utils/resources.py#L1277
The file is in /usr/lib/python3/dist-packages/yunohost/utils/resources.py
Report back if that fixes the issue or not.
I don't understand what is needed to be changed on that line 1277 ? (my file already has that exact line, and the update doesn't work, "...port 853 is used...")
@wiggins-philip @GoustiFruit Unfortunately, the fix I proposed in the OP cannot be implemented with just one line, as the function doesn't have access to the app name. I tried to set up a development environment to apply all the required changes and test the fix, but I couldn't make it successfully access the network and I had to give up (at least for now). A quick workaround is to edit the app's settings.yml file removing both the ports that block the upgrade, run the upgrade again and restore the ports in the file.
Would uninstalling/reinstalling AdGuard work ?
@GoustiFruit I think it should, but I didn't try.
Temporary workaround tested and functionnal for me :
In https://github.com/YunoHost/yunohost/blob/dd394e94dc2bc4582a2471f7fe90106713189110/src/utils/resources.py#L1291
The file is in /usr/lib/python3/dist-packages/yunohost/utils/resources.py
Step 1:
Replace
return used_by_process or used_by_app or used_by_self_provisioning
By
return 0
Step 2: Reboot (for the changes to take effect) Step 3: Update AdGuard normally via yunohost Step 4: Restore resources.py to it's original state Step 5: Reboot again And it's all good
It made it for me. Thanks !
Solved it for me, thank you!
I only had one problem and is that it complained that i used tab instead of spaces. but besides that it works!
I was having the same issue, but @Bluesmoothie 's work around fixed it for me. Thanks.
Temporary workaround tested and functionnal for me : In https://github.com/YunoHost/yunohost/blob/dd394e94dc2bc4582a2471f7fe90106713189110/src/utils/resources.py#L1291 The file is in
/usr/lib/python3/dist-packages/yunohost/utils/resources.py
Step 1: Replacereturn used_by_process or used_by_app or used_by_self_provisioning
By
return 0
Step 2: Reboot (for the changes to take effect) Step 3: Update AdGuard normally via yunohost Step 4: Restore resources.py to it's original state Step 5: Reboot again And it's all good
Describe the bug
There is an edge case issue in the port-availability check, performed when updating an application, that can prevent user from updating apps on their environments.
The
PortsResource
's functionprovision_or_update()
performs a check to see if the ports required by an application are being used by any other service/app in the system. This check is performed via theport_is_used()
method, which considers two conditions:ss --numeric --listening --tcp --udp
outputf"grep --quiet --extended-regexp \"port: '?{port}'?\" /etc/yunohost/apps/*/settings.yml"
)This means that the latter check will always fail when users are upgrading an app whose new version requires to open a port that was already listed in the app's own
settings.yml
, even if they correctly remove the port from the firewall's configuration.That's the case, for instance, for AdGuard:
A possible workaround would be to exclude the app's directory from the second check listed above, using a command like this:
os.system(f"grep --extended-regexp \"port: '?{port}'?\" /etc/yunohost/apps/*/settings.yml | grep -v --extended-regexp '^/etc/yunohost/apps/{appname}/'")
I found out this by trying to upgrade AdGuard Home on my server, and the same issue was experienced by other users as well.
Context
Logs
https://paste.yunohost.org/raw/esokoyilez