Ecodev / newsletter

TYPO3 extension to send newsletter
https://extensions.typo3.org/extension/newsletter/
25 stars 26 forks source link

Unsubscribe leads to Oops crash #104

Closed kludikovsky closed 8 years ago

kludikovsky commented 8 years ago

The unsubscribe link in the Email resulted in an error. After finding the followong Link I followed the instructions there and replaced the ###newsletter_unsubscribe_url### by http://newsletter_unsubscribe_url,

Unfortunately this created the also an Oops crash. Nevertheless the user was unsubscribed (as verified in the database table).

The generated Url

http://mydom.tld/?type=1342671779&tx_newsletter_p%5Bn%5D=5&tx_newsletter_p%5Bl%5D=a0a37b793162dcb0fde5c1a8bea0939b&tx_newsletter_p%5Baction%5D=clicked&tx_newsletter_p%5Bcontroller%5D=Link

The resulting page:

Oops, an error occurred! Code: 20160118152859b42fcaa6
PowerKiKi commented 8 years ago

Would you have any kind of log associated with that error ? I don't know if the culprit is Newsletter, but definitely TYPO3 caught something and should have logged it somewhere if you configured it to do so. Maybe in your apache logs ? or TYPO3 logs ?

githubrsys commented 8 years ago

@kludikovsky

Add this to LocalConfiguration.php "sys" array to get debug output in frontend -but only if you match the IP address. Be sure to have set your actual external IP Adress 'into devIPmask'. (Not necessarily the one of the Webserver)

https://www.whatismyip.com/

'SYS' => array(
        'debugExceptionHandler' => '',
        'devIPmask' => '127.0.0.1,xxx.xxx.xxx.xxx',
        'displayErrors' => '2',
        'enableDeprecationLog' => '0',
        'enable_errorDLOG' => '0',
        'enable_exceptionDLOG' => '0',
        'errorHandler' => '',
        'exceptionalErrors' => 'E_ALL ^ E_NOTICE ^ E_WARNING ^ E_USER_ERROR ^ E_USER_NOTICE ^ E_USER_WARNING',
        'sqlDebug' => '0',
        'systemLog' => '',
        'systemLogLevel' => '2',
    ),
kludikovsky commented 8 years ago

This is the log (little reformatted)

Tue, 26 Jan 2016 15:32:12 +0100 [ALERT] request="b7406558e6731" component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler": Oops, an error occurred! Code: 20160126153210ae735042 - {"exception":"exception 'Exception' with message 'Could not find the domain name. Use Newsletter configuration page to set 'fetch_path'' in \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3conf\/ext\/newsletter\/Classes\/Domain\/Model\/Newsletter.php:753\n
Stack trace:\n
#0 [internal function]: Ecodev\\n
ewsletter\\Domain\\Model\\n
ewsletter->getBaseUrl()\n
#1 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/extbase\/Classes\/Persistence\/Generic\/LazyLoadingProxy.php(107): call_user_func_array(Array, Array)\n
#2 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3conf\/ext\/newsletter\/Classes\/Controller\/EmailController.php(295): TYPO3\\CMS\\Extbase\\Persistence\\Generic\\LazyLoadingProxy->__call('getBaseUrl', Array)\n
#3 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3conf\/ext\/newsletter\/Classes\/Controller\/EmailController.php(295): TYPO3\\CMS\\Extbase\\Persistence\\Generic\\LazyLoadingProxy->getBaseUrl()\n
#4 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3conf\/ext\/newsletter\/Classes\/Controller\/EmailController.php(238): Ecodev\\n
ewsletter\\Controller\\EmailController->notifyUnsubscribe(Object(TYPO3\\CMS\\Extbase\\Persistence\\Generic\\LazyLoadingProxy), Object(TYPO3\\CMS\\Extbase\\Persistence\\Generic\\LazyLoadingProxy), Object(Ecodev\\n
ewsletter\\Domain\\Model\\Email))\n
#5 [internal function]: Ecodev\\n
ewsletter\\Controller\\EmailController->unsubscribeAction()\n
#6 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/extbase\/Classes\/Mvc\/Controller\/ActionController.php(283): call_user_func_array(Array, Array)\n
#7 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/extbase\/Classes\/Mvc\/Controller\/ActionController.php(176): TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController->callActionMethod()\n
#8 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/extbase\/Classes\/Mvc\/Dispatcher.php(86): TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController->processRequest(Object(TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request), Object(TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response))\n
#9 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/extbase\/Classes\/Mvc\/Web\/FrontendRequestHandler.php(69): TYPO3\\CMS\\Extbase\\Mvc\\Dispatcher->dispatch(Object(TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request), Object(TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response))\n
#10 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/extbase\/Classes\/Core\/Bootstrap.php(206): TYPO3\\CMS\\Extbase\\Mvc\\Web\\FrontendRequestHandler->handleRequest()\n
#11 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/extbase\/Classes\/Core\/Bootstrap.php(193): TYPO3\\CMS\\Extbase\\Core\\Bootstrap->handleRequest()\n
#12 [internal function]: TYPO3\\CMS\\Extbase\\Core\\Bootstrap->run('', Array)\n
#13 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/ContentObject\/ContentObjectRenderer.php(7315): call_user_func_array(Array, Array)\n
#14 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/ContentObject\/UserContentObject.php(40): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->callUserFunction('TYPO3\\\\CMS\\\\Extba...', Array, '')\n
#15 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/ContentObject\/ContentObjectRenderer.php(943): TYPO3\\CMS\\Frontend\\ContentObject\\UserContentObject->render(Array)\n
#16 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/ContentObject\/ContentObjectRenderer.php(859): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->render(Object(TYPO3\\CMS\\Frontend\\ContentObject\\UserContentObject), Array)\n
#17 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/Controller\/TypoScriptFrontendController.php(3566): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->cObjGetSingle('USER', Array)\n
#18 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/Controller\/TypoScriptFrontendController.php(3511): TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController->INTincScript_process(Array)\n
#19 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/Controller\/TypoScriptFrontendController.php(3477): TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController->recursivelyReplaceIntPlaceholdersInContent()\n
#20 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/Http\/RequestHandler.php(232): TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController->INTincScript()\n
#21 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/core\/Classes\/Core\/Bootstrap.php(302): TYPO3\\CMS\\Frontend\\Http\\RequestHandler->handleRequest(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))\n
#22 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/typo3\/sysext\/frontend\/Classes\/Http\/Application.php(78): TYPO3\\CMS\\Core\\Core\\Bootstrap->handleRequest(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))\n
#23 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/index.php(33): TYPO3\\CMS\\Frontend\\Http\\Application->run()\n
#24 [internal function]: {closure}()\n
#25 \/var\/www\/vhosts\/mydom.tld\/httpdocs\/typo3_src-7.6.2\/index.php(34): call_user_func(Object(Closure))\n
#26 {main}"}

My basic.fetch_path (string) ist empty based on the statement Leave blank to use domain-records from the page tree. Now this might be the error as I don't have a dedicated domain record in the tree.

I also have not set

Redirect page (pid|url) on unsubscribe
basic.unsubscribe_redirect (string)

If this value is set, on unsubscribe the user will be redirected to the corresponding page.

bacause it's all in the same domain.

Solution: I have now set basic.fetch_path to my domain and it worked ok.

Thnx.

githubrsys commented 8 years ago

Setting no domain-record in pagetree can lead to unpredictable behaviour. It is best practice to set such a.

Cheers.

PowerKiKi commented 8 years ago

@kludikovsky where you able to send a Newsletter with the same configuration as when unsubscribing lead to errors ?

kludikovsky commented 8 years ago

I have now sent a another (test) newsletter and it worked ok.

I had just another weird thing:

When i tried it first it failed. Then i checked the setting of basic.fetch_pathvia the TER and this was empty again. (?????) I have no idead how this could happen, as I checked this alreay some days ago and reported above (see above). So I scratch my head:

I will watch as I know what the reason is.

I consider this can be closed for now. Thnx