Error when try a save profile settings when changing settings for AntiVirus (when using an ICAP profile)

I get an error when saving the settings - Exception
socket_set_timeout(): Argument #1 ($stream) must be of type resource, bool given in file ‘/var/www/nextcloud/apps/files_antivirus/lib/ICAP/ICAPClient.php’ line 70

The same issue on nextcloud 28.0.8, 29.0.4, PHP8.2.20

Looking at the Source-Code (files_antivirus/lib/ICAP/ICAPClient.php at master · nextcloud/files_antivirus · GitHub) this can happen, when there is a problem connecting to the ICAP-Server. Are you sure, the Nextcloud instance can connect to the ICAP Server?

I guess the devs should do the Stream check before calling the stream_set_timeout, so you at least get a proper ErrorMessage.

1 Like

I agree. You feel like submitting a pull request with a proposed adjustment to that repository?

Yes. I opened a PR here.

1 Like

Yes, you are right, if ICAP server is unavailable, this error appears, which is incorrect.