When I try to add discussions and send notify, I get failed ajax request error

I successfully updated from OJS 3.3.0-15 to OJS 3.4.0-4. But I encountered two problems.

I cannot add discussions and send Notify inParticipants.

I have Cyberpanel on the server and I am using php 8.1.

You can see the error in the image below.

The error log is as follows:

2023-12-07 18:08:23.329509 [NOTICE] [366387] [kayit4076.655340] add child process pid: 413098
2023-12-07 18:08:23.329698 [INFO] [366387] [kayit4076.655340]: unlocked pid file [/tmp/lshttpd/kayit4076.sock.pid].
2023-12-07 18:08:24.002051 [NOTICE] [366387] [89.252.131.116:42127-Q:366FF423EAFCFA44-0#ojs] [STDERR] PHP Fatal error:  Uncaught TypeError: Symfony\Component\Mailer\Transport\Dsn::__construct(): Argument #2 ($host) must be of type string, null given, called in /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php on line 186 and defined in /public_html/lib/pkp/lib/vendor/symfony/mailer/Transport/Dsn.php:28
Stack trace:
#0 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(186): Symfony\Component\Mailer\Transport\Dsn->__construct()
#1 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(164): Illuminate\Mail\MailManager->createSmtpTransport()
#2 /public_html/lib/pkp/classes/core/MailServiceProvider.php(61): Illuminate\Mail\MailManager->createSymfonyTransport()
#3 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(97): Illuminate\Mail\MailManager@anonymous->resolve()
#4 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(75): Illuminate\Mail\MailManager->get()
#5 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(554): Illuminate\Mail\MailManager->mailer()
#6 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): Illuminate\Mail\MailManager->__call()
#7 /public_html/lib/pkp/classes/mail/variables/ContextEmailVariable.php(112): Illuminate\Support\Facades\Facade::__callStatic()
#8 /public_html/classes/mail/variables/ContextEmailVariable.php(55): PKP\mail\variables\ContextEmailVariable->getContextSignature()
#9 /public_html/lib/pkp/classes/mail/Mailable.php(234): APP\mail\variables\ContextEmailVariable->values()
#10 /public_html/lib/pkp/classes/mail/Mailable.php(219): PK
2023-12-07 18:08:24.002107 [NOTICE] [366387] [89.252.131.116:42127-Q:366FF423EAFCFA44-0#ojs] [STDERR] P\mail\Mailable->setData()
#11 /public_html/lib/pkp/controllers/grid/queries/form/QueryForm.php(272): PKP\mail\Mailable->getData()
#12 /public_html/lib/pkp/controllers/grid/queries/QueriesGridHandler.php(362): PKP\controllers\grid\queries\form\QueryForm->fetch()
#13 [internal function]: PKP\controllers\grid\queries\QueriesGridHandler->addQuery()
#14 /public_html/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()
#15 /public_html/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest()
#16 /public_html/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter->route()
#17 /public_html/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher->dispatch()
#18 /public_html/index.php(21): PKP\core\PKPApplication->execute()
#19 {main}
  thrown in /public_html/lib/pkp/lib/vendor/symfony/mailer/Transport/Dsn.php on line 28
2023-12-07 18:08:28.472548 [NOTICE] [366387] [89.252.131.116:42127-Q:366FF423EAFCFA44-4#ojs] [STDERR] PHP Fatal error:  Uncaught TypeError: Symfony\Component\Mailer\Transport\Dsn::__construct(): Argument #2 ($host) must be of type string, null given, called in /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php on line 186 and defined in /public_html/lib/pkp/lib/vendor/symfony/mailer/Transport/Dsn.php:28
Stack trace:
#0 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(186): Symfony\Component\Mailer\Transport\Dsn->__construct()
#1 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(164): Illuminate\Mail\MailManager->createSmtpTransport()
#2 /public_html/lib/pkp/classes/core/MailServiceProvider.php(61): Illuminate\Mail\MailManager->createSymfonyTransport()
#3 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(97): Illuminate\Mail\MailManager@anonymous->resolve()
#4 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(75): Illuminate\Mail\MailManager->get()
#5 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(554): Illuminate\Mail\MailManager->mailer()
#6 /public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): Illuminate\Mail\MailManager->__call()
#7 /public_html/lib/pkp/classes/mail/variables/ContextEmailVariable.php(112): Illuminate\Support\Facades\Facade::__callStatic()
#8 /public_html/classes/mail/variables/ContextEmailVariable.php(55): PKP\mail\variables\ContextEmailVariable->getContextSignature()
#9 /public_html/lib/pkp/classes/mail/Mailable.php(234): APP\mail\variables\ContextEmailVariable->values()
#10 /public_html/lib/pkp/classes/mail/Mailable.php(219): PK
2023-12-07 18:08:28.472601 [NOTICE] [366387] [89.252.131.116:42127-Q:366FF423EAFCFA44-4#ojs] [STDERR] P\mail\Mailable->setData()
#11 /public_html/lib/pkp/controllers/grid/users/stageParticipant/form/PKPStageParticipantNotifyForm.php(104): PKP\mail\Mailable->getData()
#12 /public_html/lib/pkp/controllers/grid/users/stageParticipant/StageParticipantGridHandler.php(527): PKP\controllers\grid\users\stageParticipant\form\PKPStageParticipantNotifyForm->fetch()
#13 [internal function]: PKP\controllers\grid\users\stageParticipant\StageParticipantGridHandler->viewNotify()
#14 /public_html/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()
#15 /public_html/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest()
#16 /public_html/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter->route()
#17 /public_html/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher->dispatch()
#18 /public_html/index.php(21): PKP\core\PKPApplication->execute()
#19 {main}
  thrown in /public_html/lib/pkp/lib/vendor/symfony/mailer/Transport/Dsn.php on line 28

Can you help me?

Regards,

Hi @Mustafa_COKYASAR,

Did you add the new email configuration option to config.inc.php that was mentioned in the 3.4.0 release notes? See:

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for your quick response. When I changed the e-mail sending method with sendmail, the problem was resolved, but this time the e-mail is not delivered even though the SMTP settings are correct.

My SMTP settings are as follows:

;;;;;;;;;;;;;;;;;;
; Email Settings ;
;;;;;;;;;;;;;;;;;;

[email]

; Default method to send emails
; Available options: sendmail, smtp, log, phpmailer
default = sendmail

; Path to the sendmail, -bs argument is for using SMTP protocol
sendmail_path = "/usr/sbin/sendmail -bs"

; Use SMTP for sending mail instead of mail()
; smtp = On

; SMTP server settings
; smtp_server = email-smtp.us-east-1.amazonaws.com
; smtp_port = 587

; Enable SMTP authentication
; Supported smtp_auth: ssl, tls (see PHPMailer SMTPSecure)
; smtp_auth = tls
; smtp_username = ****
; smtp_password = ****

; Enable suppressing SSL/TLS peer verification by SMTP transports
; Note: this is not recommended for security reasons
; smtp_suppress_cert_check = On

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
; allow_envelope_sender = On

; Default envelope sender to use if none is specified elsewhere
; default_envelope_sender = ****@***.com

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide no-reply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = On

; Force a DMARC compliant from header (RFC5322.From)
; If any of your users have email addresses in domains not under your control
; you may need to set this to be compliant with DMARC policies published by
; those 3rd party domains.
; Setting this will move the users address into the reply-to field and the
; from field wil be rewritten with the default_envelope_sender.
; To use this you must set force_default_enveloper_sender = On and
; default_envelope_sender must be set to a valid address in a domain you own.
; force_dmarc_compliant_from = On

; The display name to use with a DMARC compliant from header
; By default the DMARC compliant from will have an empty name but this can
; be changed by adding a text here.
; You can use '%n' to insert the users name from the original from header
; and '%s' to insert the localized sitename.
; dmarc_compliant_from_displayname = '%n via %s'

; If enabled, email addresses must be validated before login is possible.
require_validation = Off

; Maximum number of days before an unvalidated account expires and is deleted
validation_timeout = 14

Hi @Mustafa_COKYASAR,

Lines starting with ; are treated as comments, so your SMTP configuration isn’t active. If you want to use SMTP, remove the ; from the start of the relevant lines, and set default to smtp rather than sendmail.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for reminding me the difference between looking and seeing. :smile: