GithubHelp home page GithubHelp logo

christophwurst / nextcloud_sentry Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 5.0 1.71 MB

Sentry integration for Nextcloud

License: GNU Affero General Public License v3.0

PHP 86.87% JavaScript 13.13%
sentry sentry-client sentry-php crash-reporting nextcloud

nextcloud_sentry's Introduction

Nextcloud Sentry Integration

Downloads

A Sentry integration that sends unhandled exceptions to a Sentry instance to aggregate application crashes. You either have to set up your own Sentry instance or use your sentry.io account. See the admin documentation for how to configure this app.

Sentry screenshot

Documentation

nextcloud_sentry's People

Contributors

asbiin avatar christophwurst avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar jakubonderka avatar juliushaertl avatar morrisjobke avatar renovate[bot] avatar rullzer avatar tcitworld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nextcloud_sentry's Issues

Browser Console Warning to start shipping own version of jQuery

Steps to reproduce

  1. Run Nextcloud Version 19(.0.3)
  2. Run Sentry App Version 7.0.0
  3. Open Logging page in Admin Settings

Expected behaviour

Browser Console should be clear of warnings and errors from Sentry JavaScript.

Actual behaviour

About 10 warnings per second from sentry.js:

$ is deprecated: The global jQuery is deprecated. It will be updated to v2.4 in Nextcloud 20 and v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.

Track release version on client-side too

Feature Request

To work with regressions it's necessary to have the release version on js reports (like on php ones). Current reports are hard to correlate with releases.

Performance monitoring

Feature Request

Besides error tracking, Sentry also offers performance monitoring capabilities https://docs.sentry.io/product/performance/

Summary

It would probably be interesting to see this can also be used to trace performance metrics of certain operations like db transactions, controller execution or app bootstrap for example. It would also be available for the frontend where it could even gather web vitals metrics.

https://docs.sentry.io/platforms/php/performance/
https://docs.sentry.io/platforms/javascript/performance/
https://docs.sentry.io/product/performance/web-vitals/

We might be able to use or extend the already existing OCP\Diagnostics\IEventLogger for that in the server https://github.com/nextcloud/server/blob/215aef3cbdc1963be1bb6bca5218ee0a4b7f1665/lib/public/Diagnostics/IEventLogger.php#L31

Excessive logging of include errors

Steps to reproduce

Enable app on latest version (8.0.0)

Expected behaviour

No errors

Actual behaviour

Tons of logs for almost every request, but not ending up in sentry:

{
  "reqId": "i0iKODT1U4tXRSnUoMQR",
  "level": 3,
  "time": "2021-07-15T13:02:10+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "PHP",
  "method": "",
  "url": "--",
  "message": "include(/var/www/nextcloud/apps/updatenotification/composer/composer/../composer/InstalledVersions.php): failed to open stream: No such file or directory at /var/www/nextcloud/lib/composer/composer/ClassLoader.php#480",
  "userAgent": "--",
  "version": "22.0.0.11",
  "exception": {
    "Exception": "Error",
    "Message": "include(/var/www/nextcloud/apps/updatenotification/composer/composer/../composer/InstalledVersions.php): failed to open stream: No such file or directory at /var/www/nextcloud/lib/composer/composer/ClassLoader.php#480",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 480,
        "function": "onError",
        "class": "OC\\Log\\ErrorHandler",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 480,
        "function": "include"
      },
      {
        "file": "/var/www/nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 346,
        "function": "Composer\\Autoload\\includeFile"
      },
      {
        "function": "loadClass",
        "class": "Composer\\Autoload\\ClassLoader",
        "type": "->"
      },
      {
        "function": "spl_autoload_call"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/jean85/pretty-package-versions/src/PrettyVersions.php",
        "line": 46,
        "function": "method_exists"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/jean85/pretty-package-versions/src/PrettyVersions.php",
        "line": 19,
        "function": "checkProvidedPackages",
        "class": "Jean85\\PrettyVersions",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/sentry/sentry/src/ClientBuilder.php",
        "line": 79,
        "function": "getVersion",
        "class": "Jean85\\PrettyVersions",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/sentry/sentry/src/ClientBuilder.php",
        "line": 87,
        "function": "__construct",
        "class": "Sentry\\ClientBuilder",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/sentry/sentry/src/functions.php",
        "line": 17,
        "function": "create",
        "class": "Sentry\\ClientBuilder",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/lib/AppInfo/Application.php",
        "line": 71,
        "function": "Sentry\\init"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 160,
        "function": "OCA\\Sentry\\AppInfo\\{closure}",
        "class": "OCA\\Sentry\\AppInfo\\Application",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",
        "line": 118,
        "function": "OC\\AppFramework\\Utility\\{closure}",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 127,
        "function": "offsetGet",
        "class": "Pimple\\Container",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 454,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/ServerContainer.php",
        "line": 145,
        "function": "queryNoFallback",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Support/CrashReport/Registry.php",
        "line": 126,
        "function": "query",
        "class": "OC\\ServerContainer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Support/CrashReport/Registry.php",
        "line": 81,
        "function": "loadLazyProviders",
        "class": "OC\\Support\\CrashReport\\Registry",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Log.php",
        "line": 232,
        "function": "delegateBreadcrumb",
        "class": "OC\\Support\\CrashReport\\Registry",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Log.php",
        "line": 191,
        "function": "log",
        "class": "OC\\Log",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/legacy/OC_App.php",
        "line": 181,
        "function": "debug",
        "class": "OC\\Log",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/legacy/OC_App.php",
        "line": 139,
        "function": "loadApp",
        "class": "OC_App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Console/Application.php",
        "line": 119,
        "function": "loadApps",
        "class": "OC_App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/console.php",
        "line": 98,
        "function": "loadCommands",
        "class": "OC\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/occ",
        "line": 11,
        "args": [
          "/var/www/nextcloud/console.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php",
    "Line": 92,
    "CustomMessage": "--"
  }
}
{
  "reqId": "i0iKODT1U4tXRSnUoMQR",
  "level": 3,
  "time": "2021-07-15T13:02:10+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "PHP",
  "method": "",
  "url": "--",
  "message": "include(): Failed opening '/var/www/nextcloud/apps/updatenotification/composer/composer/../composer/InstalledVersions.php' for inclusion (include_path='/var/www/nextcloud/apps-extra/news/vendor/pear/net_url2:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Crypt_Blowfish:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Date:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Exception:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Idna:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Imap_Client:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_ListHeaders:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Mail:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_ManageSieve:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Mime:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Nls:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Secret:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Smtp:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Socket_Client:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Stream:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Stream_Filter:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Stream_Wrapper:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Stringprep:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Support:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Text_Filter:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Text_Flowed:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Translation:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Util:/var/www/nextcloud/3rdparty/pear/archive_tar:/var/www/nextcloud/3rdparty/pear/console_getopt:/var/www/nextcloud/3rdparty/pear/pear-core-minimal/src:/var/www/nextcloud/3rdparty/pear/pear_exception:/var/www/nextcloud/apps:/var/www/nextcloud/apps-extra') at /var/www/nextcloud/lib/composer/composer/ClassLoader.php#480",
  "userAgent": "--",
  "version": "22.0.0.11",
  "exception": {
    "Exception": "Error",
    "Message": "include(): Failed opening '/var/www/nextcloud/apps/updatenotification/composer/composer/../composer/InstalledVersions.php' for inclusion (include_path='/var/www/nextcloud/apps-extra/news/vendor/pear/net_url2:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Crypt_Blowfish:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Date:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Exception:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Idna:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Imap_Client:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_ListHeaders:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Mail:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_ManageSieve:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Mime:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Nls:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Secret:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Smtp:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Socket_Client:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Stream:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Stream_Filter:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Stream_Wrapper:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Stringprep:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Support:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Text_Filter:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Text_Flowed:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Translation:/var/www/nextcloud/apps-extra/mail/vendor/pear-pear.horde.org/Horde_Util:/var/www/nextcloud/3rdparty/pear/archive_tar:/var/www/nextcloud/3rdparty/pear/console_getopt:/var/www/nextcloud/3rdparty/pear/pear-core-minimal/src:/var/www/nextcloud/3rdparty/pear/pear_exception:/var/www/nextcloud/apps:/var/www/nextcloud/apps-extra') at /var/www/nextcloud/lib/composer/composer/ClassLoader.php#480",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 480,
        "function": "onError",
        "class": "OC\\Log\\ErrorHandler",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 480,
        "function": "include"
      },
      {
        "file": "/var/www/nextcloud/lib/composer/composer/ClassLoader.php",
        "line": 346,
        "function": "Composer\\Autoload\\includeFile"
      },
      {
        "function": "loadClass",
        "class": "Composer\\Autoload\\ClassLoader",
        "type": "->"
      },
      {
        "function": "spl_autoload_call"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/jean85/pretty-package-versions/src/PrettyVersions.php",
        "line": 46,
        "function": "method_exists"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/jean85/pretty-package-versions/src/PrettyVersions.php",
        "line": 19,
        "function": "checkProvidedPackages",
        "class": "Jean85\\PrettyVersions",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/sentry/sentry/src/ClientBuilder.php",
        "line": 79,
        "function": "getVersion",
        "class": "Jean85\\PrettyVersions",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/sentry/sentry/src/ClientBuilder.php",
        "line": 87,
        "function": "__construct",
        "class": "Sentry\\ClientBuilder",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/vendor/sentry/sentry/src/functions.php",
        "line": 17,
        "function": "create",
        "class": "Sentry\\ClientBuilder",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/sentry/lib/AppInfo/Application.php",
        "line": 71,
        "function": "Sentry\\init"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 160,
        "function": "OCA\\Sentry\\AppInfo\\{closure}",
        "class": "OCA\\Sentry\\AppInfo\\Application",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",
        "line": 118,
        "function": "OC\\AppFramework\\Utility\\{closure}",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 127,
        "function": "offsetGet",
        "class": "Pimple\\Container",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 454,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/ServerContainer.php",
        "line": 145,
        "function": "queryNoFallback",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Support/CrashReport/Registry.php",
        "line": 126,
        "function": "query",
        "class": "OC\\ServerContainer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Support/CrashReport/Registry.php",
        "line": 81,
        "function": "loadLazyProviders",
        "class": "OC\\Support\\CrashReport\\Registry",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Log.php",
        "line": 232,
        "function": "delegateBreadcrumb",
        "class": "OC\\Support\\CrashReport\\Registry",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Log.php",
        "line": 191,
        "function": "log",
        "class": "OC\\Log",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/legacy/OC_App.php",
        "line": 181,
        "function": "debug",
        "class": "OC\\Log",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/legacy/OC_App.php",
        "line": 139,
        "function": "loadApp",
        "class": "OC_App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Console/Application.php",
        "line": 119,
        "function": "loadApps",
        "class": "OC_App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/console.php",
        "line": 98,
        "function": "loadCommands",
        "class": "OC\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/occ",
        "line": 11,
        "args": [
          "/var/www/nextcloud/console.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php",
    "Line": 92,
    "CustomMessage": "--"
  }
}

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update dependency psalm/phar to ^5.24.0
  • fix(deps): update dependency @nextcloud/initial-state to ^2.2.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

composer
composer.json
  • nyholm/psr7 ^1.8.1
  • php-http/curl-client ^2.3.2
  • psr/log ^1
  • sentry/sentry ^3.22.1
  • guzzlehttp/promises ^1.5.3
  • christophwurst/nextcloud_testing ^1.0.0
  • psalm/phar ^5.23.1
github-actions
.github/workflows/appstore-build-publish.yml
  • actions/checkout v4
  • skjnldsv/read-package-engines-version-actions v2.2
  • actions/setup-node v4
  • shivammathur/setup-php v2
  • andstor/file-existence-action v3
  • actions/checkout v4
  • svenstaro/upload-release-action v2
  • nextcloud-releases/nextcloud-appstore-push-action v1
.github/workflows/build.yml
  • actions/setup-node v4
.github/workflows/conventional_commits.yml
  • actions/checkout v4
  • webiny/action-conventional-commits v1.3.0
.github/workflows/fixup.yml
  • xt0rted/block-autosquash-commits-action v2
.github/workflows/lint.yml
.github/workflows/release.yml
  • actions/checkout v4
  • TriPSs/conventional-changelog-action v5
  • actions/create-release v1
.github/workflows/static-analysis.yml
  • actions/checkout v4
  • shivammathur/setup-php v2
.github/workflows/test.yml
  • shivammathur/setup-php v2
  • actions/checkout v4
  • shivammathur/setup-php v2
  • actions/checkout v4
npm
package.json
  • @nextcloud/auth ^2.2.1
  • @nextcloud/initial-state ^2.1.0
  • @nextcloud/logger ^2.7.0
  • @sentry/browser ^7.108.0
  • webpack ^5.91.0
  • webpack-cli ^5.1.4
  • webpack-merge ^5.10.0

  • Check this box to trigger a request for Renovate to run again on this repository

Collect breadcrums of log

Would be good to also collect breadcrums from logging (DEBUG, INFO etc). So that when stuff does ๐Ÿ’ฅ we have more context

This will require sever changes as well so something for NC15

Declaration of AbstractLogger::emergency must be compatible with

Steps to reproduce

  1. install Nextcloud 25.0.3 with PHP 8.1
  2. install sentry plugin
  3. set my sentry sentry in config.php
  4. refresh my nextcloud page in the browser
  5. broken 500 screen
  6. if I comment out the sentry entries in the config.php my nextcloud installation works normal again

Expected behaviour

Nextcloud should keep running and submit errors to my sentry installation

Actual behaviour

  • Website shows 500 Server Error.
  • as I have a PHP experience my research concluded, that my nextcloud instance uses an old Version of PSR, which is not compatible to the one you use in the sentry plugin. But as I have no knowledge of the nextcloud architecture I could not go further into the debugging

Server configuration

Operating system: Ubuntu 22.04 (kubernetes docker)

Web server: Apache/2.4.52

Database: bitnami/mariadb:10.6.12-debian-11-r3

PHP version: PHP 8.1.16

Version: Nextcloud 25.0.3

Updated from an older version or fresh install: fresh install

List of activated apps:

  - activity: 2.17.0
  - calendar: 4.2.3
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contacts: 5.1.0
  - contactsinteraction: 1.6.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - deck: 1.8.3
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - groupfolders: 13.1.1
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - mail: 2.2.3
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recognize: 3.5.0
  - recommendations: 1.4.0
  - related_resources: 1.0.3
  - sentry: 8.6.4
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - spreed: 15.0.3
  - support: 1.8.0
  - survey_client: 1.13.0
  - systemtags: 1.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - bruteforcesettings
  - encryption
  - files_external
  - richdocuments: 7.1.1
  - suspicious_login
  - twofactor_totp
  - user_ldap

The content of config/config.php:

$CONFIG = array (
  'instanceid' => 'xxxxxxxxxxxxxxxxx',
  'passwordsalt' => 'yyyyyyyyyyyyyyyyyy',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.server.my',
  ),
  'trusted_proxies' => 
  array (
    0 => '10.188.5.1',
  ),
  'htaccess.RewriteBase' => '/',
  'overwritehost' => 'nextcloud.server.my',
  'overwriteprotocol' => 'https',
  'datadirectory' => '/data',
  'dbtype' => 'mysql',
  'version' => '25.0.3.2',
  'overwrite.cli.url' => 'https://nextcloud.server.my',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextcloud-mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxxxxxxxxxxxxxxxxx',
  'installed' => true,
  'default_phone_region' => 'DE',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'nextcloud-redis-master',
    'port' => 6379,
    'password' => 'xxxxxxxxxxxxxxxxxxxx',
  ),
  'sentry.dsn' => 'https://xxxxxxxxxxxxxxxxxxxxxxxxxxx:[email protected]/4',
  'sentry.public-dsn' => 'https://[email protected]/4',
);

Client configuration

  • any client any browser

Logs

Web server error log
[Sat Feb 18 22:11:29.338850 2023] [php:error] [pid 745] [client 10.42.0.10:55886] PHP Fatal error: Declaration of Psr\\Log\\AbstractLogger::emergency(Stringable|string $message, array $context = []): void must be compatible with Psr\\Log\\LoggerInterface::emergency($message, array $context = []) in /var/www/project/public/apps/sentry/vendor/psr/log/src/LoggerTrait.php on line 23
Server log (data/nextcloud.log)
{
  "reqId": "iivsgGX1sn6zMSERyXXX",
  "level": 3,
  "time": "2023-02-18T22:00:01+00:00",
  "remoteAddr": "10.42.0.10",
  "user": "--",
  "app": "PHP",
  "method": "GET",
  "url": "/cron.php",
  "message": "Declaration of Psr\\Log\\AbstractLogger::emergency(Stringable|string $message, array $context = []): void must be compatible with Psr\\Log\\LoggerInterface::emergency($message, array $context = []) at /var/www/project/public/apps/sentry/vendor/psr/log/src/LoggerTrait.php#23",
  "userAgent": "curl/7.74.0",
  "version": "25.0.3.2",
  "data": {
    "app": "PHP"
  }
}
Browser log
Browser shows Server 500 error

Declaration of Aws\S3\ObjectCopier::promise() must be compatible with GuzzleHttp\Promise\PromisorInterface::promise()

Steps to reproduce

  1. Install both richdocuments and nextcloud_sentry
  2. Try to save (or autosave) a document
  3. Document can't be saved

Server configuration

Operating system: Debian

Web server: nginx

Database: PostgreSQL

PHP version: 8.1

Version: (see admin page) 26.0.8

Updated from an older version or fresh install:

List of activated apps:

richdocuments: 8.0.6
sentry: 8.8.9

Logs

Server log (data/nextcloud.log)
{"reqId":"jKuSceM8SBZ6dMBmaGyn","level":3,"time":"2023-11-17T09:03:05+00:00","remoteAddr":"::ffff:5.9.69.82","user":"admin","app":"PHP","method":"POST","url":"/index.php/apps/richdocuments/wopi/files/288_ocioexg3r5rp/contents?access_token=YRfi4FqMMIGOOFqSPDcH6MX94pGnSZq5&access_token_ttl=1700247682000","message":"Declaration of Aws\\S3\\ObjectCopier::promise() must be compatible with GuzzleHttp\\Promise\\PromisorInterface::promise(): GuzzleHttp\\Promise\\PromiseInterface at /var/www/nc/nextcloud-26.0.8/3rdparty/aws/aws-sdk-php/src/S3/ObjectCopier.php#82","userAgent":"COOLWSD HTTP Agent 23.05.5.4","version":"26.0.8.2","data":{"app":"PHP"}}

Ran find . -name "PromisorInterface.php" into my install folder, returns:

./3rdparty/guzzlehttp/promises/src/PromisorInterface.php
./apps/sentry/vendor/guzzlehttp/promises/src/PromisorInterface.php

So I'm guessing this is very similar to #517. Funny to see it's broken since d650d43 and no one reported it. ๐Ÿค”

Can we compose the dependencies with Mozart here too? Otherwise just pinning guzzlehttp/promises to 1.x versions should be fine for now.

Minimum log level default and settings is not applied

Steps to reproduce

I have been using the Sentry app for some time. Every month my free Sentry quota gets eaten up in a matter of a few days. Contrary to the docs here the log level apparently isn't set to warning. I have a lot of debug entries in sentry and even some info ones.
I tried fixing this with the minimum log level setting. I tried setting it by hand and via the cli. None worked.

Expected behaviour

Minimum sentry log level is warning by default.
Minimum sentry log level can be set with config.php setting.

Actual behaviour

Minimum sentry log level defaults and settings are not applied.

Server configuration detail

Operating system: Linux 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.1.47

PHP version:

7.4.12
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, bcmath, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

Nextcloud version: 19.0.5 - 19.0.5.2

Updated from an older Nextcloud/ownCloud or fresh install: yes

Where did you install Nextcloud from: Docker

Signing status
List of activated apps
Enabled:
 - accessibility: 1.5.0
 - activity: 2.12.1
 - admin_audit: 1.9.0
 - apporder: 0.11.0
 - audioplayer: 2.13.0
 - bookmarks: 3.4.9
 - breezedark: 19.0.9
 - bruteforcesettings: 2.0.1
 - calendar: 2.0.4
 - camerarawpreviews: 0.7.9
 - checksum: 0.4.5
 - circles: 0.19.9
 - cloud_federation_api: 1.2.0
 - comments: 1.9.0
 - contacts: 3.4.2
 - contactsinteraction: 1.0.0
 - cospend: 1.0.5
 - data_request: 1.6.0
 - dav: 1.15.0
 - deck: 1.2.2
 - drawio: 0.9.7
 - event_update_notification: 1.0.2
 - federatedfilesharing: 1.9.0
 - federation: 1.9.0
 - files: 1.14.0
 - files_3d: 0.3.3
 - files_downloadactivity: 1.8.0
 - files_fulltextsearch: 1.4.3
 - files_fulltextsearch_tesseract: 1.4.2
 - files_linkeditor: 1.1.2
 - files_markdown: 2.3.1
 - files_mindmap: 0.0.23
 - files_pdfviewer: 1.8.0
 - files_photospheres: 1.19.1
 - files_rightclick: 0.16.0
 - files_sharing: 1.11.0
 - files_trashbin: 1.9.0
 - files_versions: 1.12.0
 - files_videoplayer: 1.8.0
 - firstrunwizard: 2.8.0
 - flowupload: 1.1.2
 - forms: 2.0.4
 - fulltextsearch: 1.4.2
 - fulltextsearch_elasticsearch: 1.5.2
 - groupfolders: 7.1.1
 - impersonate: 1.6.1
 - issuetemplate: 0.7.0
 - keeweb: 0.6.3
 - logreader: 2.4.0
 - lookup_server_connector: 1.7.0
 - mail: 1.4.1
 - maps: 0.1.6
 - metadata: 0.12.0
 - music: 0.17.3
 - nextcloud_announcements: 1.8.0
 - notes: 3.6.4
 - notifications: 2.7.0
 - oauth2: 1.7.0
 - ownpad: 0.6.15
 - password_policy: 1.9.1
 - phonetrack: 0.6.4
 - photos: 1.1.0
 - piwik: 0.7.0
 - polls: 1.6.2
 - privacy: 1.3.0
 - provisioning_api: 1.9.0
 - quota_warning: 1.8.0
 - ransomware_detection: 0.8.0
 - recommendations: 0.7.0
 - richdocuments: 3.7.9
 - sentry: 7.0.0
 - serverinfo: 1.9.0
 - settings: 1.1.0
 - sharebymail: 1.9.0
 - socialsharing_diaspora: 2.1.0
 - socialsharing_email: 2.1.0
 - socialsharing_facebook: 2.1.0
 - socialsharing_twitter: 2.1.0
 - spreed: 9.0.6
 - survey_client: 1.7.0
 - talk_simple_poll: 1.2.0
 - tasks: 0.13.6
 - text: 3.0.1
 - theming: 1.10.0
 - timemanager: 0.1.6
 - timetracker: 0.0.45
 - twofactor_admin: 3.0.0
 - twofactor_backupcodes: 1.8.0
 - twofactor_gateway: 0.17.0
 - twofactor_nextcloud_notification: 2.3.0
 - twofactor_totp: 5.0.0
 - twofactor_u2f: 6.0.0
 - updatenotification: 1.9.0
 - viewer: 1.3.0
 - workflowengine: 2.1.0
Disabled:
 - announcementcenter
 - browser_warning
 - dashboard
 - documentserver_community
 - dropit
 - encryption
 - external
 - extract
 - files_external
 - files_external_gdrive
 - files_external_onedrive
 - files_reader
 - files_readmemd
 - group_everyone
 - hsts
 - mindmaps
 - news
 - occweb
 - ocsms
 - onlyoffice
 - previewgenerator
 - rainloop
 - ransomware_protection
 - sharelisting
 - sharerenamer
 - support
 - systemtags
 - telephoneprovider
 - twofactor_email
 - twofactor_yubikey
 - uploaddetails
 - user_ldap
 - whiteboard

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "***REMOVED SENSITIVE VALUE***",
        "***REMOVED SENSITIVE VALUE***",
        "***REMOVED SENSITIVE VALUE***"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "19.0.5.2",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "forcessl": true,
    "logtimezone": "Europe\/Berlin",
    "log_rotate_size": 104857600,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauth": 1,
    "mail_smtpauthtype": "LOGIN",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtpsecure": "ssl",
    "htaccess.RewriteBase": "\/",
    "htaccess.IgnoreFrontController": true,
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
    "overwriteprotocol": "https",
    "skeletondirectory": "",
    "auth.bruteforce.protection.enabled": true,
    "check_for_working_webdav": true,
    "maintenance": false,
    "loglevel": 0,
    "debug": false,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379
    },
    "updater.release.channel": "stable",
    "mysql.utf8mb4": true,
    "theme": "",
    "sentry.dsn": "https:\/\/[email protected]\/1756997",
    "sentry.public-dsn": "https:\/\/[email protected]\/1756997",
    "sentry.csp-report-url": "https:\/\/sentry.io\/api\/1756997\/security\/?sentry_key=0725a66e07fe4f3bb5e5eb837ec4fcda",
    "app_install_overwrite": [
        "keeweb"
    ],
    "trashbin_retention_obligation": "7,30",
    "versions_retention_obligation": "30,180",
    "activity_expire_days": 180,
    "sentry.minimum.log.level": 3,
    "enabledPreviewProviders": [
        "OC\\Preview\\BMP",
        "OC\\Preview\\GIF",
        "OC\\Preview\\HEIC",
        "OC\\Preview\\JPEG",
        "OC\\Preview\\Krita",
        "OC\\Preview\\MarkDown",
        "OC\\Preview\\MP3",
        "OC\\Preview\\OpenDocument",
        "OC\\Preview\\PNG",
        "OC\\Preview\\TXT",
        "OC\\Preview\\XBitmap",
        "OC\\Preview\\Movie"
    ]
}

Are you using external storage, if yes which one:

Are you using encryption:

Are you using an external user-backend, if yes which one:

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36

Operating system:

Logs

Web server error log

Nextcloud log

Browser log

Add admin settings

For easy of use a simple admin settings page would make configuration even easier.

Not urgent at all but still nice to have :)

Unlimited recursion with LDAP

Steps to reproduce

  1. Connect Nextcloud to LDAP
  2. Enable Sentry plugin
  3. Loggin to Nextcloud with LDAP account
  4. Access Nextcloud page after around half hour (probably after session expires)

Expected behaviour

Login screen is shown.

Actual behaviour

PHP-FPM is killed by SIGSERV because of unlimited recursion. (BTW, according to PHP team, SIGSERV for infinite recursion is not a bug).

Whats the problem

It took long time to debug that, but the problem is here:

  1. During loading user from LDAP, user_ldap app logs debug info:

https://github.com/nextcloud/server/blob/c00d6f4eac9075e651fbef791f4e7c7157cad709/apps/user_ldap/lib/Access.php#L2030-L2033

  1. Sentry plugins try to add more info for that log:

public function collect(string $message, string $category, array $context = []) {
$this->setSentryScope($context);

  1. The info contains also info about current user:

protected function setSentryScope(array $context): void {
configureScope(function (Scope $scope) use ($context): void {
if (isset($context['level'])) {
$scope->setLevel(
new Severity($this->levels[$context['level']])
);
}
if (isset($context['app'])) {
$scope->setExtra('app', $context['app']);
}
$user = $this->userSession->getUser();

  1. getUser method tries to load more info from LDAP.
  2. GOTO 1;

How to solve

The solution can be just remove setSentryScope call from collect() method:

$this->setSentryScope($context);

Then breadcrumbs will not contains additional information, but from my perspective that information are not that useful for breadcrumb.

Trackback after second call of initPagedSearch()

#0  OCA\User_LDAP\Access->initPagedSearch() called at [/var/www/nextcloud/apps/user_ldap/lib/Access.php:267]
#1  OCA\User_LDAP\Access->executeRead() called at [/var/www/nextcloud/apps/user_ldap/lib/Access.php:214]
#2  OCA\User_LDAP\Access->readAttribute() called at [/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php:320]
#3  OCA\User_LDAP\User_LDAP->userExistsOnLDAP() called at [/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php:372]
#4  OCA\User_LDAP\User_LDAP->userExists()
#5  call_user_func_array() called at [/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php:81]
#6  OCA\User_LDAP\User_Proxy->walkBackends() called at [/var/www/nextcloud/apps/user_ldap/lib/Proxy.php:152]
#7  OCA\User_LDAP\Proxy->handleRequest() called at [/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php:173]
#8  OCA\User_LDAP\User_Proxy->userExists() called at [/var/www/nextcloud/lib/private/User/Manager.php:138]
#9  OC\User\Manager->get() called at [/var/www/nextcloud/lib/private/User/Session.php:231]
#10 OC\User\Session->getUser() called at [/var/www/nextcloud/apps/sentry/lib/Reporter/SentryReporterAdapter.php:100]
#11 OCA\Sentry\Reporter\SentryReporterAdapter->buildSentryContext() called at [/var/www/nextcloud/apps/sentry/lib/Reporter/SentryReporterAdapter.php:118]
#12 OCA\Sentry\Reporter\SentryReporterAdapter->collect() called at [/var/www/nextcloud/lib/private/Support/CrashReport/Registry.php:57]
#13 OC\Support\CrashReport\Registry->delegateBreadcrumb() called at [/var/www/nextcloud/lib/private/Log.php:222]
#14 OC\Log->log() called at [/var/www/nextcloud/lib/public/Util.php:121]
#15 OCP\Util::writeLog() called at [/var/www/nextcloud/apps/user_ldap/lib/Access.php:2003]
#16 OCA\User_LDAP\Access->initPagedSearch() called at [/var/www/nextcloud/apps/user_ldap/lib/Access.php:267]
#17 OCA\User_LDAP\Access->executeRead() called at [/var/www/nextcloud/apps/user_ldap/lib/Access.php:214]
#18 OCA\User_LDAP\Access->readAttribute() called at [/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php:320]
#19 OCA\User_LDAP\User_LDAP->userExistsOnLDAP() called at [/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php:372]
#20 OCA\User_LDAP\User_LDAP->userExists()
#21 call_user_func_array() called at [/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php:81]
#22 OCA\User_LDAP\User_Proxy->walkBackends() called at [/var/www/nextcloud/apps/user_ldap/lib/Proxy.php:152]
#23 OCA\User_LDAP\Proxy->handleRequest() called at [/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php:173]
#24 OCA\User_LDAP\User_Proxy->userExists() called at [/var/www/nextcloud/lib/private/User/Manager.php:138]
#25 OC\User\Manager->get() called at [/var/www/nextcloud/lib/private/User/Session.php:231]
#26 OC\User\Session->getUser() called at [/var/www/nextcloud/apps/sentry/lib/Reporter/SentryReporterAdapter.php:100]
#27 OCA\Sentry\Reporter\SentryReporterAdapter->buildSentryContext() called at [/var/www/nextcloud/apps/sentry/lib/Reporter/SentryReporterAdapter.php:118]
#28 OCA\Sentry\Reporter\SentryReporterAdapter->collect() called at [/var/www/nextcloud/lib/private/Support/CrashReport/Registry.php:57]
#29 OC\Support\CrashReport\Registry->delegateBreadcrumb() called at [/var/www/nextcloud/lib/private/Log.php:222]
#30 OC\Log->log() called at [/var/www/nextcloud/lib/public/Util.php:121]
#31 OCP\Util::writeLog() called at [/var/www/nextcloud/apps/user_ldap/lib/Access.php:2003]
#32 OCA\User_LDAP\Access->initPagedSearch() called at [/var/www/nextcloud/apps/user_ldap/lib/Access.php:267]
#33 OCA\User_LDAP\Access->executeRead() called at [/var/www/nextcloud/apps/user_ldap/lib/Access.php:214]
#34 OCA\User_LDAP\Access->readAttribute() called at [/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php:320]
#35 OCA\User_LDAP\User_LDAP->userExistsOnLDAP() called at [/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php:372]
#36 OCA\User_LDAP\User_LDAP->userExists()
#37 call_user_func_array() called at [/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php:81]
#38 OCA\User_LDAP\User_Proxy->walkBackends() called at [/var/www/nextcloud/apps/user_ldap/lib/Proxy.php:152]
#39 OCA\User_LDAP\Proxy->handleRequest() called at [/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php:173]
#40 OCA\User_LDAP\User_Proxy->userExists() called at [/var/www/nextcloud/lib/private/User/Manager.php:138]
#41 OC\User\Manager->get() called at [/var/www/nextcloud/lib/private/User/Session.php:231]
#42 OC\User\Session->getUser() called at [/var/www/nextcloud/lib/private/User/Session.php:272]
#43 OC\User\Session->isLoggedIn() called at [/var/www/nextcloud/lib/base.php:959]
#44 OC::handleRequest() called at [/var/www/nextcloud/index.php:42]

PHP 8 Support

Related to #292 php8 was introduced in v21. 7.x will continue to be supported for now. Thanks!

public dsn not set for public Nextcloud pages

Steps to reproduce

  1. Go to public page
  2. See browser console

Expected behaviour

See nothing and get Sentry reports.

Actual behaviour

Info: no Sentry dsn found, no errors will be reported, sentry.js:23:147

App version: 2.0.0

Bug in SentryReporterAdapter::collect

Hi, if you check Bug in SentryReporterAdapter::collect method, I think there is a bug with $level variables. Because now, $level is boolean (isset returns boolean) and that boolean value is used in next line as array key.

public function collect(string $message, string $category, array $context = []) {
	$this->setSentryScope($context);

	$level = isset($context['level']);
	$sentryLevel = $this->levels[$level] ?? Breadcrumb::LEVEL_WARNING;
	
	addBreadcrumb(new Breadcrumb($sentryLevel, Breadcrumb::TYPE_ERROR, $category, $message));
}

Maybe the correct code should be like this?

public function collect(string $message, string $category, array $context = []) {
	$this->setSentryScope($context);

	$level = $context['level'] ?? ILogger::WARN;
	$sentryLevel = $this->levels[$level] ?? Breadcrumb::LEVEL_WARNING;
	
	addBreadcrumb(new Breadcrumb($sentryLevel, Breadcrumb::TYPE_ERROR, $category, $message));
}

Automatic report functionality

Would not it be useful to automatically report errors to NextCloud? (in an anonymised way, of course, so maybe only report the general issue and not too many details)

So when issues are introduced or so in the wild, NextCloud may notice a special type of error report is common. Other software, like Browsers, also have crash reporters doing something similar, so might help you too.

[bug] Deprecated warning of "Replacing the data" since version 2.3 of Sentry SDK

Steps to reproduce

Run Nextcloud 17.0.3 and at latest app version 3.4.0
This might not be version specific to both Nextcloud and the app.

Expected behaviour

No errors in logs/sentry

Actual behaviour

Errors in logs/sentry:

[PHP] Error: Replacing the data is deprecated since version 2.3 and will stop working from version 3.0. Set the second argument to `true` to merge the data instead. at /var/www/html/custom_apps/sentry/vendor/sentry/sentry/src/State/Scope.php#181 GET /settings/ajax/checksetup

Error comes from this code line: https://github.com/getsentry/sentry-php/blob/9ea19135d1943593a1b9903dee069f15fc503301/src/State/Scope.php#L181

Server configuration detail

Operating system: Linux 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.1.44

PHP version:

7.3.14
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

Nextcloud version: 17.0.3 - 17.0.3.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: Docker

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.3.0
 - activity: 2.10.1
 - admin_audit: 1.7.0
 - announcementcenter: 3.6.1
 - audioplayer: 2.9.0
 - bookmarks: 2.3.4
 - bruteforcesettings: 1.5.0
 - calendar: 2.0.1
 - camerarawpreviews: 0.7.3
 - checksum: 0.4.4
 - circles: 0.17.10
 - cloud_federation_api: 1.0.0
 - comments: 1.7.0
 - contacts: 3.1.8
 - cospend: 0.3.2
 - data_request: 1.4.0
 - dav: 1.13.0
 - deck: 0.8.0
 - drawio: 0.9.4
 - dropit: 0.3.0
 - event_update_notification: 1.0.1
 - federatedfilesharing: 1.7.0
 - federation: 1.7.0
 - files: 1.12.0
 - files_downloadactivity: 1.6.0
 - files_fulltextsearch: 1.3.6
 - files_fulltextsearch_tesseract: 1.3.2
 - files_linkeditor: 1.0.11
 - files_markdown: 2.2.0
 - files_mindmap: 0.0.17
 - files_pdfviewer: 1.6.0
 - files_photospheres: 1.0.6
 - files_readmemd: 1.1.3
 - files_rightclick: 0.15.1
 - files_sharing: 1.9.0
 - files_trashbin: 1.7.0
 - files_versions: 1.10.0
 - files_videoplayer: 1.6.0
 - firstrunwizard: 2.6.0
 - flowupload: 0.1.8
 - forms: 1.1.0
 - fulltextsearch: 1.3.8
 - fulltextsearch_elasticsearch: 1.4.1
 - gallery: 18.4.0
 - groupfolders: 5.0.5
 - impersonate: 1.4.0
 - issuetemplate: 0.6.0
 - keeweb: 0.6.2
 - logreader: 2.2.0
 - lookup_server_connector: 1.5.0
 - mail: 1.1.2
 - metadata: 0.11.1
 - music: 0.13.0
 - nextcloud_announcements: 1.6.0
 - notes: 3.1.5
 - notifications: 2.5.0
 - oauth2: 1.5.0
 - ocsms: 2.1.6
 - onlyoffice: 4.1.4
 - ownpad: 0.6.14
 - password_policy: 1.7.0
 - phonetrack: 0.6.2
 - polls: 1.3.0
 - privacy: 1.1.0
 - provisioning_api: 1.7.0
 - quota_warning: 1.6.0
 - ransomware_detection: 0.6.0
 - ransomware_protection: 1.5.1
 - recommendations: 0.5.0
 - richdocuments: 3.5.2
 - sentry: 6.2.1
 - serverinfo: 1.7.0
 - sharebymail: 1.7.0
 - sharerenamer: 2.7.3
 - socialsharing_diaspora: 1.0.5
 - socialsharing_email: 1.0.6
 - socialsharing_facebook: 1.0.5
 - socialsharing_twitter: 1.0.5
 - spreed: 7.0.2
 - talk_simple_poll: 1.0.0
 - tasks: 0.11.3
 - telephoneprovider: 1.0.3
 - text: 1.1.1
 - theming: 1.8.0
 - twofactor_admin: 2.0.0
 - twofactor_backupcodes: 1.6.0
 - twofactor_email: 1.0.1
 - twofactor_gateway: 0.15.1
 - twofactor_nextcloud_notification: 2.2.0
 - twofactor_totp: 4.1.2
 - twofactor_u2f: 5.0.2
 - updatenotification: 1.7.0
 - uploaddetails: 0.1.3
 - user_usage_report: 1.1.2
 - viewer: 1.2.0
 - workflowengine: 1.7.0
Disabled:
 - afterlogic
 - apporder
 - browser_warning
 - dashboard
 - encryption
 - external
 - extract
 - files_3d
 - files_external
 - files_external_gdrive
 - files_external_onedrive
 - files_reader
 - group_everyone
 - hsts
 - mindmaps
 - news
 - occweb
 - previewgenerator
 - radio
 - rainloop
 - sharelisting
 - support
 - survey_client
 - systemtags
 - twofactor_yubikey
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "***REMOVED SENSITIVE VALUE***",
        "***REMOVED SENSITIVE VALUE***"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "17.0.3.1",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "forcessl": true,
    "logtimezone": "Europe\/Berlin",
    "log_rotate_size": 104857600,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauth": 1,
    "mail_smtpauthtype": "LOGIN",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtpsecure": "ssl",
    "htaccess.RewriteBase": "\/",
    "htaccess.IgnoreFrontController": true,
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
    "overwriteprotocol": "https",
    "skeletondirectory": "",
    "auth.bruteforce.protection.enabled": true,
    "check_for_working_webdav": true,
    "maintenance": false,
    "loglevel": 0,
    "debug": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379
    },
    "updater.release.channel": "stable",
    "mysql.utf8mb4": true,
    "theme": "",
    "sentry.dsn": "***REMOVED SENSITIVE VALUE***",
    "sentry.public-dsn": "***REMOVED SENSITIVE VALUE***",
    "sentry.csp-report-url": "***REMOVED SENSITIVE VALUE***",
    "app_install_overwrite": [
        "keeweb"
    ]
}

Are you using external storage, if yes which one: no

Are you using encryption: false

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36

Operating system:

Logs

Web server error log

Nextcloud log

Browser log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.