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

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

Closed
SimJoSt opened this issue Feb 29, 2020 · 3 comments · Fixed by #232
Closed

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

SimJoSt opened this issue Feb 29, 2020 · 3 comments · Fixed by #232

Comments

@SimJoSt
Copy link

SimJoSt commented Feb 29, 2020

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
@ChristophWurst
Copy link
Owner

Yep, noticed that as well. I guess we should only run this once. Would you be interested in learning more about how to contribute a fix?

@SimJoSt
Copy link
Author

SimJoSt commented Apr 25, 2020

Generally yes. I am familiar with Git, PRs, etc (project manager with a technical background).
The limiting factor would probably my time, as I am already contributing in a lot of other places ;)

If this is a straight forward problem and the fix is trivial, but the work needs to be done and tested, you can give me some pointers so I or somebody else can tackle it as soon as there is some time.

@ChristophWurst
Copy link
Owner

We init sentry at

initSentry([
'dsn' => $dsn,
'release' => $config->getSystemValue('version', '0.0.0'),
]);
. The user data is set at
configureScope(function (Scope $scope) use ($context): void {
if (isset($context['level'])) {
$scope->setLevel(
new Severity(self::levels[$context['level']])
);
}
if (isset($context['app'])) {
$scope->setTag('app', $context['app']);
}
$user = $this->userSession->getUser();
if ($user !== null) {
// Try to obtain the login name as well
try {
$credentials = $this->credentialStoreHelper->getLoginCredentials();
$username = $credentials->getLoginName();
} catch (CredentialsUnavailableException $e) {
$username = null;
}
$scope->setUser([
'id' => $user->getUID(),
'username' => $username,
]);
}
});
. We might move the latter call to the former, so it's just executed once.

ChristophWurst added a commit that referenced this issue Aug 26, 2020
Fixes #184

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
ChristophWurst added a commit that referenced this issue Aug 26, 2020
Fixes #184

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants