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

Call to a member function getEMailAddress() on null in /var/www/nextcloud/apps/firstrunwizard/lib/Notification/Notifier.php:134 #735

Closed
7 of 9 tasks
atol71 opened this issue Aug 30, 2022 · 1 comment · Fixed by #952

Comments

@atol71
Copy link

atol71 commented Aug 30, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

When adding php -f /var/www/nextcloud/cron.php to cron according to instructions in Nextcloud www-pages i get email error report:

Error: Call to a member function getEMailAddress() on null in /var/www/nextcloud/apps/firstrunwizard/lib/Notification/Notifier.php:134
Stack trace:
#0 /var/www/nextcloud/apps/firstrunwizard/lib/Notification/Notifier.php(97): OCA\FirstRunWizard\Notification\Notifier->getSubject()
nextcloud/server#1 /var/www/nextcloud/lib/private/Notification/Manager.php(376): OCA\FirstRunWizard\Notification\Notifier->prepare()
nextcloud/server#2 /var/www/nextcloud/apps/notifications/lib/MailNotifications.php(196): OC\Notification\Manager->prepare()
nextcloud/server#3 /var/www/nextcloud/apps/notifications/lib/MailNotifications.php(166): OCA\Notifications\MailNotifications->sendEmailToUser()
nextcloud/server#4 /var/www/nextcloud/apps/notifications/lib/BackgroundJob/SendNotificationMails.php(49): OCA\Notifications\MailNotifications->sendEmails()
nextcloud/server#5 /var/www/nextcloud/lib/public/BackgroundJob/Job.php(79): OCA\Notifications\BackgroundJob\SendNotificationMails->run()
nextcloud/server#6 /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php(95): OCP\BackgroundJob\Job->execute()
nextcloud/server#7 /var/www/nextcloud/cron.php(151): OCP\BackgroundJob\TimedJob->execute()
nextcloud/server#8 {main}

All users have email addresses.

Steps to reproduce

Add php -f /var/www/nextcloud/cron.php to cron.

Expected behavior

Clarifying what email address is missing.

Installation method

Community Web installer on a VPS or web space

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.quantum-black-hole.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "24.0.4.1",
        "overwrite.cli.url": "https:\/\/cloud.quantum-black-hole.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "app_install_overwrite": [
            "user_saml",
            "ojsxc"
        ],
        "theme": "",
        "loglevel": 2,
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN"
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - bruteforcesettings: 2.4.0
  - calendar: 3.4.3
  - circles: 24.0.1
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.2.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - deck: 1.7.1
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - mail: 1.13.8
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - recommendations: 1.3.0
  - richdocuments: 6.2.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - sociallogin: 4.16.2
  - spreed: 14.0.4
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - updatenotification: 1.14.0
  - user_ldap: 1.14.1
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - oidc_login: 2.3.2
  - ojsxc: 5.0.0
  - user_saml: 5.0.2

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"jf3L9MoS0gYuUbmERDpQ","level":2,"time":"2021-12-15T10:59:16+00:00","remoteAddr":"45.13.104.179","user":"--","app":"no app in context","method":"HEAD","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"python-requests/2.25.1","version":""}
{"reqId":"jf3L9MoS0gYuUbmERDpQ","level":2,"time":"2021-12-15T10:59:16+00:00","remoteAddr":"45.13.104.179","user":"--","app":"no app in context","method":"HEAD","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"python-requests/2.25.1","version":""}
{"reqId":"hTWPiUGOeaY4eUiWlR4V","level":2,"time":"2021-12-15T10:59:17+00:00","remoteAddr":"107.189.6.166","user":"--","app":"no app in context","method":"HEAD","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"python-requests/2.25.1","version":""}
{"reqId":"hTWPiUGOeaY4eUiWlR4V","level":2,"time":"2021-12-15T10:59:17+00:00","remoteAddr":"107.189.6.166","user":"--","app":"no app in context","method":"HEAD","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"python-requests/2.25.1","version":""}
{"reqId":"82zvt2LU5CS7BxBOSPzN","level":2,"time":"2021-12-15T10:59:40+00:00","remoteAddr":"45.153.160.137","user":"--","app":"no app in context","method":"HEAD","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"python-requests/2.25.1","version":""}
{"reqId":"82zvt2LU5CS7BxBOSPzN","level":2,"time":"2021-12-15T10:59:40+00:00","remoteAddr":"45.153.160.137","user":"--","app":"no app in context","method":"HEAD","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"python-requests/2.25.1","version":""}
{"reqId":"sWLGDIbBIftVEBGnXkQp","level":2,"time":"2021-12-15T11:10:11+00:00","remoteAddr":"192.168.1.10","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0","version":""}
{"reqId":"sWLGDIbBIftVEBGnXkQp","level":2,"time":"2021-12-15T11:10:11+00:00","remoteAddr":"192.168.1.10","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0","version":""}
{"reqId":"30wwX8ktXrqpLsHua8bs","level":2,"time":"2021-12-15T11:12:49+00:00","remoteAddr":"192.168.1.10","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0","version":""}
{"reqId":"30wwX8ktXrqpLsHua8bs","level":2,"time":"2021-12-15T11:12:49+00:00","remoteAddr":"192.168.1.10","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0","version":""}

Additional info

No response

@tcitworld tcitworld transferred this issue from nextcloud/server Aug 30, 2022
@tcitworld tcitworld changed the title cron php -f /var/www/nextcloud/cron.php fails Call to a member function getEMailAddress() on null in /var/www/nextcloud/apps/firstrunwizard/lib/Notification/Notifier.php:134 Aug 30, 2022
@Ralf99
Copy link

Ralf99 commented Apr 6, 2023

Hi all, I think I have either the same or at least a very similar bug that is only a few lines different from the reported BUG.

My error message (which I always get via eMail) looks like this

Error: Call to a member function getEMailAddress() on null in /www/htdocs/nextcloud/apps/firstrunwizard/lib/Notification/Notifier.php:135 Stack trace: #0 /www/htdocs/nextcloud/apps/firstrunwizard/lib/Notification/Notifier.php(97): OCA\FirstRunWizard\Notification\Notifier->getSubject(Object(OC\Notification\Notification), 'en') #1 /www/htdocs/nextcloud/lib/private/Notification/Manager.php(368): OCA\FirstRunWizard\Notification\Notifier->prepare(Object(OC\Notification\Notification), 'en') #2 /www/htdocs/nextcloud/apps/notifications/lib/MailNotifications.php(198): OC\Notification\Manager->prepare(Object(OC\Notification\Notification), 'en') #3 /www/htdocs/nextcloud/apps/notifications/lib/MailNotifications.php(168): OCA\Notifications\MailNotifications->sendEmailToUser(Object(OCA\Notifications\Model\Settings), Array, 'en', 'UTC') #4 /www/htdocs/nextcloud/apps/notifications/lib/BackgroundJob/SendNotificationMails.php(49): OCA\Notifications\MailNotifications->sendEmails(25, 1680806402) #5 /www/htdocs/nextcloud/lib/public/BackgroundJob/Job.php(78): OCA\Notifications\BackgroundJob\SendNotificationMails->run(NULL) #6 /www/htdocs/nextcloud/lib/public/BackgroundJob/TimedJob.php(103): OCP\BackgroundJob\Job->start(Object(OC\BackgroundJob\JobList)) #7 /www/htdocs/nextcloud/lib/public/BackgroundJob/TimedJob.php(93): OCP\BackgroundJob\TimedJob->start(Object(OC\BackgroundJob\JobList)) #8 /www/htdocs/nextcloud/cron.php(177): OCP\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log)) #9 {main}

Can anyone help us?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants