-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Can't sign document after recent update #4376
Comments
@LosHunterros what's the steps that you made when you got this message? Could you provide a list of apps that you have installed? |
I think that this is duplicated of: |
App list: Activity |
I don't think so because 2 weeks ago everything was fine. But i will check |
If i disable footer everything indeed works fine. But before update that was not a problem... |
Screen record |
Thanks by your help to solve this. Could you provide the output of the follow command?
WIth the app ids will be more easy to setup your apps and check if will work fine. I made tests here at Nextcloud 29, 30 and 31 and worked fine. I think that have other app affecting LibreSign. Also would be good to have the log from your nextcoud.log file, if is creating any entry at the moment that you click to sign the document. |
Apps:
This error is from Nextcloud logs:
|
I make tests at many servers with Nextcloud 30 and 29 and didn't reproduced this issue. I think that is related to an app at your environment that is loading the public function setLogger(LoggerInterface $logger); The newest definition is: public function setLogger(LoggerInterface $logger): void; Maybe sending here the return of this grep made at nextcloud folder could help to think what's could be the problem:
I identified that at Nextcloud <= 30 is using the oldest definition of this method, at Nextcloud 31 this already was changed but Nextcloud 31 istn't a stable release yet. I think that an app is loading this file at a middleware trigged before LibreSign. Analyzing this case yet. |
Return:
|
Could you test to change the follow row?
Add I think that is a problem at GitHub Action that generate the release. |
Unfortunately did not help |
Ignore the previous message. At Nextcloud 30 the 3rdparty dependency need to be without I think that could be something related to APC cache because I reproduced this at a server that had the version 10.4.4 and I made the upgrade to 10.5.2. After then, to identify what's happening, I deleted the libresign folder, made a clone of repository, made the build and installed the composer dependencies, the error was solved. I deleted the folder that I made the clone and installed again from appstore and I can't reproduce the error again. |
Could you test with the newest release? |
Still same error. |
I'm getting this same error. I just tried blowing away my APC cache -- deleted the container running PHP and redeployed it, same 500 error on the client and mpdf error about the loggerAwareInterface. |
So for me, the errors were in the mpdf vendor library:
Just to test, I edited that file - /var/www/cloud/apps/libresign/vendor/mpdf/psr-log-aware-trait/src/MpdfPsrLogAwareTrait.php - and added the :void return type, and then I got the same error in the next file:
... after adding the same :void return type to that method, I was able to successfully sign a document! So the issue for me at least is an out of date Mpdf vendor library... |
Hi @freelock I downloaded the tar.gz file of LibreSign At 3rdparty folder of Nextcloud 30: https://github.com/nextcloud/3rdparty/blob/stable30/psr/log/src/LoggerAwareTrait.php#L22 public function setLogger(LoggerInterface $logger) And at Nextcloud 29 is: public function setLogger(LoggerInterface $logger) Looking the grep made by @LosHunterros, I found that the app
Could you test to disable the app mail and check if will work fine without any change at the code? I will make the same here to check if I can reproduce. |
I identified that the problem is at side of app mail, look here the screenshot of tar.gz of version 4.1.2, the latest version compatible with Nextcloud 30: Will be necessary report this issue at repository of app Mail. You will need to open an issue at mail app. I will close this issue for now because is not an issue of LibreSign. Follow a suggestion of issue. Title: Version of psr/log incompatible with the same version at 3rdparty folder At 3rdparty folder compatible with Nextcloud 30 is using the versoin 2.0 of psr/log that haven't the :void at interface: https://github.com/nextcloud/3rdparty/blob/stable30/composer.lock#L3296-L3297 "name": "psr/log",
"version": "2.0.0", https://github.com/php-fig/log/blob/2.0.0/src/LoggerAwareTrait.php#L22 public function setLogger(LoggerInterface $logger) But at "name": "psr/log",
"version": "3.0.2", And the signature of method setLogger at this version is: public function setLogger(LoggerInterface $logger): void The different signature of this interface generate error about inconsistent declaration of ref: #4376 |
Hi, I'm not familiar with NextCloud plugin architecture -- but I do a lot of PHP development, primarily Drupal, with composer. I don't think closing this is the right solution -- I don't think mail or NC core will want to downgrade libraries. What is the best practice for including vendor libraries for NextCloud plugins? On my instance, I'm seeing 7 installs of the PSR\log package:
... so if your theory is correct, that it's the one in Mail that has a different signature, why is Libresign loading that library copy instead of its own? Adding return types is something I'm seeing in a bunch of libraries now -- it's a sign of a newer library version. So I think the correct solution would be to update the vendor libraries in LibreSign (assuming there's a compatible version of the mpdf library). I don't see a composer.json in the project root of either plugin, but I do see that the psr/log/composer.json has an extra.branch-alias, and the one in Mail is 3.0.x-dev, while the one in LibreSign is 2.0.x-dev. |
Ok, digging a bit deeper, I think this is just a packaging issue -- the composer.json/composer.lock that's in the project root here, on the main branch, shows psr/log at 3.0.2 -- but that's not what's in my filesystem after updating the plugin through the app. Also, it's showing mpdf/mpdf at 8.2.5, which is compatible with psr/log ^3.0 (in addition to ^1 and ^2). I see in the composer.lock that that requires mpdf/psr-log-aware-trait at either ^2.0 or ^3.0, and according to the lock file it should have v3.0.0. However, when I look at these source files on github - https://github.com/mpdf/psr-log-aware-trait/tree/3.x/src - they do show the :void type on each of those traits, but that's not what's on my installation. So it's definitely some packaging issue here in LibreSign -- whatever came through in the App update did not entirely update its own vendor libraries. I think this might be checked in some PHP versions but not others, which could be why it's failing for only some people -- or else the plugin update process isn't working fully, and people are ending up with different vendor libs. This does point out a larger issue with this plugin -- possibly all NextCloud plugins? You should be able to load your expected vendor lib and not one for an entirely different plugin! But it does look like you already have a compatible version that fixes this particular issue in your source tree -- so the question is, why didn't it get updated correctly in the package? |
Nextcloud use composer as autoload to include all dependencies. The version of psr/log at server is the 2.0 and LibreSign use this version. The version of psr/log used by app Mail is 3.0. To run a process of an app, the lifecycle of Nextcloud will load all apps to identify if have any event or middleware created by any app to run before the app process.
Yes, this can affect all apps that use psr/log or have a dependency that need to install the package psr/log. The app will install the right version but together with the app mail will get a conflict. |
…y folder What's I made: downgrade psr/log from 3 to 2. Reason: At 3rdparty folder compatible with Nextcloud 30 is using the versoin 2.0 of psr/log that haven't the :void at interface: https://github.com/nextcloud/3rdparty/blob/stable30/composer.lock#L3296-L3297 ```json "name": "psr/log", "version": "2.0.0", ``` https://github.com/nextcloud/3rdparty/blob/stable30/psr/log/src/LoggerAwareTrait.php#L22 ```php public function setLogger(LoggerInterface $logger) ``` https://github.com/php-fig/log/blob/2.0.0/src/LoggerAwareTrait.php#L22 ```php public function setLogger(LoggerInterface $logger) ``` But at `composer.lock` file of mail app, the used version is: https://github.com/nextcloud/mail/blob/main/composer.lock#L2274-L2275 ```json "name": "psr/log", "version": "3.0.2", ``` And the signature of method setLogger at this version is: https://github.com/php-fig/log/blob/3.0.2/src/LoggerAwareTrait.php#L18 ```php public function setLogger(LoggerInterface $logger): void ``` The different signature of this interface generate error about inconsistent declaration of `Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger)`. ref: LibreSign/libresign#4376 Signed-off-by: Vitor Mattos <[email protected]>
…y folder Downgrade `psr/log` from 3 to 2. The file `appinfo/info.xml` of app Mail is using a range of stable versions: ```xml <nextcloud min-version="30" max-version="32" /> ``` At branch `stable30` of `3rdparty` folder of server, is using the versoin 2.0 of `psr/log` https://github.com/nextcloud/3rdparty/blob/stable30/composer.lock#L3296-L3297 ```json "name": "psr/log", "version": "2.0.0", ``` that haven't the :void at interface: https://github.com/nextcloud/3rdparty/blob/stable30/psr/log/src/LoggerAwareTrait.php#L22 ```php public function setLogger(LoggerInterface $logger) ``` Look the code at `psr/log` repository: https://github.com/php-fig/log/blob/2.0.0/src/LoggerAwareTrait.php#L22 ```php public function setLogger(LoggerInterface $logger) ``` But at `composer.json` and at `composer-lock` file of mail, the used version is `3.0.2`: `composer.json` https://github.com/nextcloud/mail/blob/main/composer.json#L41 ```json "psr/log": "^3.0.2", ``` `composer-lock` https://github.com/nextcloud/mail/blob/main/composer.lock#L2274-L2275 ```json "name": "psr/log", "version": "3.0.2", ``` And the signature of method setLogger at version 3.0.2 is: https://github.com/php-fig/log/blob/3.0.2/src/LoggerAwareTrait.php#L18 ```php public function setLogger(LoggerInterface $logger): void ``` The different signature of this interface between `3rdparty` and mail generate error about inconsistent declaration of `Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger)`. ref: LibreSign/libresign#4376 Signed-off-by: Vitor Mattos <[email protected]>
…y folder Downgrade `psr/log` from 3 to 2 reverting the PR: nextcloud#10237 The file `appinfo/info.xml` of app Mail is using a range of stable versions: ```xml <nextcloud min-version="30" max-version="32" /> ``` At branch `stable30` of `3rdparty` folder of server, is using the versoin 2.0 of `psr/log` https://github.com/nextcloud/3rdparty/blob/stable30/composer.lock#L3296-L3297 ```json "name": "psr/log", "version": "2.0.0", ``` that haven't the :void at interface: https://github.com/nextcloud/3rdparty/blob/stable30/psr/log/src/LoggerAwareTrait.php#L22 ```php public function setLogger(LoggerInterface $logger) ``` Look the code at `psr/log` repository: https://github.com/php-fig/log/blob/2.0.0/src/LoggerAwareTrait.php#L22 ```php public function setLogger(LoggerInterface $logger) ``` But at `composer.json` and at `composer-lock` file of mail, the used version is `3.0.2`: `composer.json` https://github.com/nextcloud/mail/blob/main/composer.json#L41 ```json "psr/log": "^3.0.2", ``` `composer-lock` https://github.com/nextcloud/mail/blob/main/composer.lock#L2274-L2275 ```json "name": "psr/log", "version": "3.0.2", ``` And the signature of method setLogger at version 3.0.2 is: https://github.com/php-fig/log/blob/3.0.2/src/LoggerAwareTrait.php#L18 ```php public function setLogger(LoggerInterface $logger): void ``` The different signature of this interface between `3rdparty` and mail generate error about inconsistent declaration of `Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger)`. Only is possible upgrade the version of psr/log when the `min-version` at `info.xml` file is equals to 31 because the bump only was made since stable31 of 3rdparty. ref: LibreSign/libresign#4376 ref: LibreSign/libresign#4376 Signed-off-by: Vitor Mattos <[email protected]>
…y folder Downgrade `psr/log` from 3 to 2 reverting the PR: nextcloud#10237 The file `appinfo/info.xml` of app Mail is using a range of stable versions: ```xml <nextcloud min-version="30" max-version="32" /> ``` At branch `stable30` of `3rdparty` folder of server, is using the versoin 2.0 of `psr/log` https://github.com/nextcloud/3rdparty/blob/stable30/composer.lock#L3296-L3297 ```json "name": "psr/log", "version": "2.0.0", ``` that haven't the :void at interface: https://github.com/nextcloud/3rdparty/blob/stable30/psr/log/src/LoggerAwareTrait.php#L22 ```php public function setLogger(LoggerInterface $logger) ``` Look the code at `psr/log` repository: https://github.com/php-fig/log/blob/2.0.0/src/LoggerAwareTrait.php#L22 ```php public function setLogger(LoggerInterface $logger) ``` But at `composer.json` and at `composer-lock` file of mail, the used version is `3.0.2`: `composer.json` https://github.com/nextcloud/mail/blob/main/composer.json#L41 ```json "psr/log": "^3.0.2", ``` `composer-lock` https://github.com/nextcloud/mail/blob/main/composer.lock#L2274-L2275 ```json "name": "psr/log", "version": "3.0.2", ``` And the signature of method setLogger at version 3.0.2 is: https://github.com/php-fig/log/blob/3.0.2/src/LoggerAwareTrait.php#L18 ```php public function setLogger(LoggerInterface $logger): void ``` The different signature of this interface between `3rdparty` and mail generate error about inconsistent declaration of `Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger)`. Only is possible upgrade the version of psr/log when the `min-version` at `info.xml` file is equals to 31 because the version 3.x of `psr/log` only was bumped at stable31 of 3rdparty. ref: LibreSign/libresign#4376 Signed-off-by: Vitor Mattos <[email protected]>
@freelock I created the PR at app mail and will open again this issue considering that isn't a problem of LibreSign but is a problem that affect LibreSign. |
@freelock @LosHunterros @cebo-apz & @MaitreCake I made a possible hotfix here: At local environment I enabled the app mail and reproduced the issue. With this hotfix I inverted the autoload sequence maintaining the autoload of LibreSign as the first at the point that mPDF is loaded and worked fine to me. If possible, I will like if you can apply this patch at your environment and check if all will work fine. |
Error:
Declaration of Mpdf\Mpdf::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void at /var/www/chmura.topory.org/apps/libresign/vendor/mpdf/psr-log-aware-trait/src/MpdfPsrLogAwareTrait.php#15
Nextcloud: 30.0.4
Apache: 2.4.58
Ubuntu: 24.04.1 LTS
PHP: 8.3
The text was updated successfully, but these errors were encountered: