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

Can't sign document after recent update #4376

Open
LosHunterros opened this issue Jan 16, 2025 · 24 comments
Open

Can't sign document after recent update #4376

LosHunterros opened this issue Jan 16, 2025 · 24 comments
Labels
bug Something isn't working

Comments

@LosHunterros
Copy link

LosHunterros commented Jan 16, 2025

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

@github-project-automation github-project-automation bot moved this to 0. Needs triage in Roadmap Jan 16, 2025
@vitormattos
Copy link
Member

@LosHunterros what's the steps that you made when you got this message?

Could you provide a list of apps that you have installed?

@vitormattos
Copy link
Member

vitormattos commented Jan 16, 2025

I think that this is duplicated of:

@LosHunterros
Copy link
Author

@LosHunterros what's the steps that you made when you got this message?

Could you provide a list of apps that you have installed?

  1. Requesting sign via email
  2. Clicking link in email
  3. Providing email address to get confirmation code
  4. Entering confirmation code and trying to sign document
  5. Getting code 500 and error in Nextcloud logs

App list:

Activity
AppAPI
Brute-force settings
Calendar
Collaborative tags
Comments
Contacts
Contacts Interaction
Custom CSS
Dashboard
Deck
Deleted files
Discourse integration
Discourse SSO
External sites
File reminders
File sharing
Files download limit
First run wizard
Forms
Group folders
JSLoader
LibreSign
Listman
Log Reader
Mail
Monitoring
Nextcloud announcements
Nextcloud Assistant
Nextcloud Office
Nextcloud webhook support
Notes
Notifications
Notifications for calendar event updates
OpenAI and LocalAI integration
Password policy
PDF viewer
Photos
Polls
Preview Generator
Privacy
Recommendations
Related Resources
Share by mail
Support
Talk
Teams
Text
Update notification
Usage survey
User status
Versions
Whiteboard
XWiki

@LosHunterros
Copy link
Author

I think that this is duplicated of:

I don't think so because 2 weeks ago everything was fine. But i will check

@LosHunterros
Copy link
Author

I think that this is duplicated of:

If i disable footer everything indeed works fine. But before update that was not a problem...

@LosHunterros
Copy link
Author

Screen record
https://www.youtube.com/watch?v=X6yN-RgGWkA

@vitormattos
Copy link
Member

vitormattos commented Jan 16, 2025

Thanks by your help to solve this.

Could you provide the output of the follow command?

occ app:list

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.

@LosHunterros
Copy link
Author

Apps:

Enabled:
  - activity: 3.0.0
  - app_api: 4.0.3
  - assistant: 2.2.0
  - bruteforcesettings: 3.0.0
  - calendar: 5.0.9
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contacts: 6.1.3
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - deck: 1.14.3
  - discoursesso: 1.30.0
  - event_update_notification: 2.5.0
  - external: 5.5.2
  - federatedfilesharing: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - forms: 4.3.5
  - groupfolders: 18.0.8
  - integration_discourse: 2.2.0
  - integration_openai: 3.3.0
  - jsloader: 1.5.0
  - libresign: 10.5.2
  - listman: 29.0.8
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - mail: 4.1.1
  - nextcloud_announcements: 2.0.0
  - notes: 4.11.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - polls: 7.2.9
  - previewgenerator: 5.7.0
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - richdocuments: 8.5.3
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.1.2
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - text: 4.1.0
  - theming: 2.5.0
  - theming_customcss: 1.18.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - webhook_listeners: 1.1.0-dev
  - whiteboard: 1.0.4
  - workflowengine: 2.12.0
  - xwiki: 0.1.2
Disabled:
  - admin_audit: 1.20.0
  - encryption: 2.18.0
  - federation: 1.20.0 (installed 1.20.0)
  - files_external: 1.22.0
  - inventory: 0.1.2 (installed 0.1.2)
  - jsloader-master: 1.5.0
  - suspicious_login: 8.0.0
  - tasks: 0.16.1 (installed 0.16.1)
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - user_ldap: 1.21.0
  - weather_status: 1.10.0 (installed 1.10.0)

This error is from Nextcloud logs:

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.log

@vitormattos
Copy link
Member

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 LoggerInterface with an old definition of method setLogger The old definition of this method is:

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:

grep -Rn "function setLogger" --include="LoggerAwareInterface.php"

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.

@LosHunterros
Copy link
Author

Return:

data/updater-ocxvizzfcikw/backups/nextcloud-30.0.4.1-1737084564/3rdparty/psr/log/src/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);
data/updater-ocxvizzfcikw/backups/nextcloud-30.0.4.1-1737084564/apps/mail/vendor/psr/log/src/LoggerAwareInterface.php:13:    public function setLogger(LoggerInterface $logger): void;
data/updater-ocxvizzfcikw/backups/nextcloud-30.0.4.1-1737084564/apps/libresign/vendor/psr/log/src/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);
data/updater-ocxvizzfcikw/backups/nextcloud-30.0.4.1-1737084564/apps/suspicious_login/vendor/psr/log/Psr/Log/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);
data/updater-ocxvizzfcikw/backups/nextcloud-30.0.2.2-1735024992/3rdparty/psr/log/src/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);
data/updater-ocxvizzfcikw/backups/nextcloud-30.0.2.2-1735024992/apps/mail/vendor/psr/log/src/LoggerAwareInterface.php:13:    public function setLogger(LoggerInterface $logger): void;
data/updater-ocxvizzfcikw/backups/nextcloud-30.0.2.2-1735024992/apps/suspicious_login/vendor/psr/log/Psr/Log/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);
3rdparty/psr/log/src/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);
apps/mail/vendor/psr/log/src/LoggerAwareInterface.php:13:    public function setLogger(LoggerInterface $logger): void;
apps/libresign/vendor/psr/log/src/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);
apps/suspicious_login/vendor/psr/log/Psr/Log/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);

@vitormattos
Copy link
Member

vitormattos commented Jan 17, 2025

Could you test to change the follow row?

apps/libresign/vendor/psr/log/src/LoggerAwareInterface.php:17:    public function setLogger(LoggerInterface $logger);

Add :void; at end of the row, like the other rows.

I think that is a problem at GitHub Action that generate the release.

@vitormattos vitormattos added the bug Something isn't working label Jan 17, 2025
@LosHunterros
Copy link
Author

Unfortunately did not help

@vitormattos
Copy link
Member

Ignore the previous message. At Nextcloud 30 the 3rdparty dependency need to be without void and all apps need to follow this and looking the source of LibreSign at stable30 branch (used to versions 10.x.x), the psr/log dependency are at the same version of 3rdparty.

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.

@vitormattos
Copy link
Member

Could you test with the newest release?

@LosHunterros
Copy link
Author

Still same error.
Even if i disable all caching methods.

@freelock
Copy link

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.

@freelock
Copy link

So for me, the errors were in the mpdf vendor library:

2025/01/31 07:47:31 [error] 7#7: *26 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Declaration of Mpdf\Mpdf::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void in /var/www/cloud/apps/libresign/vendor/mpdf/psr-log-aware-trait/src/MpdfPsrLogAwareTrait.php on line 15" while reading response header from upstream, client: 65.101.158.70, server: cloud.freelock.com, request: "POST /ocs/v2.php/apps/libresign/api/v1/sign/uuid/81764e6f-b24c-4d56-80da-11d7306a2e3c HTTP/2.0", upstream: "fastcgi://172.18.0.8:9000", host: "cloud.freelock.com"

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:

2025/01/31 07:54:00 [error] 7#7: *26 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Declaration of Mpdf\SizeConverter::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void in /var/www/cloud/apps/libresign/vendor/mpdf/psr-log-aware-trait/src/PsrLogAwareTrait.php on line 15" while reading response header from upstream, client: 65.101.158.70, server: cloud.freelock.com, request: "POST /ocs/v2.php/apps/libresign/api/v1/sign/uuid/81764e6f-b24c-4d56-80da-11d7306a2e3c HTTP/2.0", upstream: "fastcgi://172.18.0.8:9000", host: "cloud.freelock.com"

... 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...

@vitormattos
Copy link
Member

Hi @freelock

I downloaded the tar.gz file of LibreSign 10.6.1 and LibreSign 9.9.1 and at booth cases the signature of this class wasn't with :void

Image

Image

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:
https://github.com/nextcloud/3rdparty/blob/stable29/psr/log/Psr/Log/LoggerAwareTrait.php#L22

    public function setLogger(LoggerInterface $logger)

Looking the grep made by @LosHunterros, I found that the app mail maybe is using an invalid version of package psr/log:

apps/mail/vendor/psr/log/src/LoggerAwareInterface.php:13:    public function setLogger(LoggerInterface $logger): void;

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.

@vitormattos
Copy link
Member

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:

Image

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
Description:

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 composer.lock file of mail app, the used version is:
https://github.com/nextcloud/mail/blob/main/composer.lock#L2274-L2275

            "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

    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: #4376

@github-project-automation github-project-automation bot moved this from 0. Needs triage to 4. to release in Roadmap Jan 31, 2025
@freelock
Copy link

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:

❯ find . -name LoggerAwareTrait.php
./apps/libresign/vendor/psr/log/src/LoggerAwareTrait.php
./apps/files_external_gdrive/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
./apps/mail/vendor/psr/log/src/LoggerAwareTrait.php
./apps/recognize/vendor/psr/log/src/LoggerAwareTrait.php
./apps/suspicious_login/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
./apps/bookmarks/vendor/psr/log/src/LoggerAwareTrait.php
./3rdparty/psr/log/src/LoggerAwareTrait.php

... 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.

@freelock
Copy link

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?

@vitormattos
Copy link
Member

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.
At most of apps that use composer dependencies, have the file composer/autoload.php
At this moment the interface of psr/log from app Mail is loaded in memory.
When run the process of LibreSign, already have the wrong interface used by app Mail and at the time that load the dependencies to handle the footer using MPDF, is throw the conflict with the interface of app Mail.

This does point out a larger issue with this plugin -- possibly all NextCloud plugins?

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.

vitormattos added a commit to vitormattos/mail that referenced this issue Feb 1, 2025
…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]>
vitormattos added a commit to vitormattos/mail that referenced this issue Feb 1, 2025
…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]>
vitormattos added a commit to vitormattos/mail that referenced this issue Feb 1, 2025
…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]>
vitormattos added a commit to vitormattos/mail that referenced this issue Feb 1, 2025
…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]>
@vitormattos
Copy link
Member

@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.

@vitormattos vitormattos reopened this Feb 1, 2025
@github-project-automation github-project-automation bot moved this from 4. to release to 1. to do in Roadmap Feb 1, 2025
@vitormattos
Copy link
Member

@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.

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
Status: 1. to do
Development

No branches or pull requests

3 participants