View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
17952Bug reportsPluginspublic2022-07-05 12:32
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.25.20 
Summary17952: Command action try to open uneeded session
Description

With sendMailCron : if there are error in one survey after the 1st one : it broke with Session error

Steps To Reproduce

Steps to reproduce


Download and activate sendMailCron
Create a survey, activate sendMailCron for it
Create another survey, make some error in email , activate sendMailCron
Try sendMailCron with php application/commands/console.php plugin index --target=sendMailCron sendMailCronSimulate=1

Expected result

Working (but don't send email)

Actual result

Break with
$ php application/commands/console.php plugin index --target=sendMailCron sendMailCronSimulate=1
[2022-03-14T16:31:26+01:00] [INFO] Start sendMailByCron for 129343
[2022-03-14T16:31:26+01:00] [INFO] 2 messages sent
[2022-03-14T16:31:26+01:00] [INFO] 5 messages sent
[2022-03-14T16:31:26+01:00] [INFO] Start sendMailByCron for 153868
PHP Error[2]: session_name(): Cannot change session name when headers already sent
in file /data/webdev/3LTS/framework/web/CHttpSession.php at line 206
#0 /data/webdev/3LTS/framework/web/CHttpSession.php(206): session_name()
#1 /data/webdev/3LTS/framework/base/CComponent.php(152): ConsoleHttpSession->setSessionName()
#2 /data/webdev/3LTS/framework/YiiBase.php(227): ConsoleHttpSession->set()
#3 /data/webdev/3LTS/framework/base/CModule.php(393): createComponent()
#4 /data/webdev/3LTS/framework/base/CModule.php(103): ConsoleApplication->getComponent()
#5 /data/webdev/3LTS/application/helpers/expressions/em_core_helper.php(2432): ConsoleApplication->
get()
#6 /data/webdev/3LTS/application/helpers/expressions/em_core_helper.php(1678): gT()
#7 /data/webdev/3LTS/application/helpers/expressions/em_core_helper.php(547): ExpressionManager->HasSyntaxErrors()
#8 /data/webdev/3LTS/application/helpers/expressions/em_core_helper.php(1851): ExpressionManager->RDP_Evaluate()
#9 /data/webdev/3LTS/application/helpers/expressions/em_core_helper.php(1811): ExpressionManager->sProcessStringContainingExpressionsHelper()
#10 /data/webdev/3LTS/application/helpers/expressions/em_manager_helper.php(4532): ExpressionManager->sProcessStringContainingExpressions()
#11 /data/webdev/3LTS/application/helpers/replacements_helper.php(475): ProcessString()
#12 /data/webdev/3LTS/plugins/sendMailCron/sendMailCron.php(799): ReplaceFields()
#13 /data/webdev/3LTS/plugins/sendMailCron/sendMailCron.php(521): sendMailCron->sendEmailsApi3()
#14 /data/webdev/3LTS/plugins/sendMailCron/sendMailCron.php(415): sendMailCron->sendEmails()
#15 /data/webdev/3LTS/plugins/sendMailCron/sendMailCron.php(298): sendMailCron->sendTokenMessages()
#16 unknown(0): sendMailCron->sendMailByCli()
#17 /data/webdev/3LTS/application/libraries/PluginManager/PluginManager.php(185): call_user_func()
#18 /data/webdev/3LTS/application/commands/PluginCommand.php(45): LimeSurvey\PluginManager\PluginManager->dispatchEvent()
#19 unknown(0): PluginCommand->actionIndex()
#20 /data/webdev/3LTS/framework/console/CConsoleCommand.php(178): ReflectionMethod->invokeArgs()
#21 /data/webdev/3LTS/framework/console/CConsoleCommandRunner.php(71): PluginCommand->run()
#22 /data/webdev/3LTS/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#23 /data/webdev/3LTS/framework/base/CApplication.php(185): ConsoleApplication->processRequest()
#24 /data/webdev/3LTS/application/commands/console.php(70): ConsoleApplication->run()

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)3.28
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)debian
Webserver software & version (if known)not relevant
PHP Version7.4

Users monitoring this issue

User List There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-03-14 16:38

developer   ~68667

2 solution :

  1. Create false admin session before load plugin
  2. avoid to create session

Here : it's seems to find the admin language.

I fix it with solution 2 for 3 and 5

DenisChenu

DenisChenu

2022-03-14 16:56

developer   ~68669

5.X : https://github.com/LimeSurvey/LimeSurvey/pull/2293
3.X : https://github.com/LimeSurvey/LimeSurvey/pull/2292

gabrieljenik

gabrieljenik

2022-06-27 16:21

manager   ~70568

This will be very hard to test.
By looking at the code, I guess we can merge it.
What do you think @c_schmitz @ollehar?

DenisChenu

DenisChenu

2022-06-27 16:51

developer   ~70572

This will be very hard to test.

:) Yes, need to construct a command plugin to have a lesser code issue …

DenisChenu

DenisChenu

2022-07-01 15:01

developer   ~70674

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=33616

DenisChenu

DenisChenu

2022-07-01 17:11

developer   ~70680

For 3.X : https://github.com/LimeSurvey/LimeSurvey/pull/2496

LimeBot

LimeBot

2022-07-05 12:27

administrator   ~70706

Fixed in Release 5.3.23+220705

DenisChenu

DenisChenu

2022-07-05 12:32

developer   ~70711

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=33630

Related Changesets

LimeSurvey: master a3887fb2

2022-07-01 14:40:54

DenisChenu


Committer: GitHub Details Diff
Fixed issue 17952: Command action potentially try to open uneeded session (#2293) Affected Issues
17952
mod - application/core/ConsoleHttpSession.php Diff File
mod - application/helpers/expressions/em_core_helper.php Diff File

LimeSurvey: 3.x-LTS 67059e8d

2022-07-05 12:31:59

DenisChenu


Committer: GitHub Details Diff
Fixed issue 17952: Command action try to open uneeded session (#2496)

Dev: replace the get action on ConsoleHttpSession
Affected Issues
17952
mod - application/core/ConsoleHttpSession.php Diff File
mod - application/helpers/expressions/em_core_helper.php Diff File

Issue History

Date Modified Username Field Change
2022-03-14 16:37 DenisChenu New Issue
2022-03-14 16:38 DenisChenu Note Added: 68667
2022-03-14 16:38 DenisChenu Bug heat 0 => 2
2022-03-14 16:38 DenisChenu Assigned To => DenisChenu
2022-03-14 16:38 DenisChenu Status new => assigned
2022-03-14 16:56 DenisChenu Note Added: 68669
2022-03-14 16:57 DenisChenu Assigned To DenisChenu => galads
2022-03-14 16:57 DenisChenu Status assigned => ready for code review
2022-06-27 16:21 gabrieljenik Note Added: 70568
2022-06-27 16:21 gabrieljenik Bug heat 2 => 4
2022-06-27 16:22 gabrieljenik Assigned To galads =>
2022-06-27 16:22 gabrieljenik Status ready for code review => ready for testing
2022-06-27 16:51 DenisChenu Note Added: 70572
2022-07-01 15:01 DenisChenu Changeset attached => LimeSurvey master a3887fb2
2022-07-01 15:01 DenisChenu Note Added: 70674
2022-07-01 15:01 DenisChenu Assigned To => DenisChenu
2022-07-01 15:01 DenisChenu Resolution open => fixed
2022-07-01 17:11 DenisChenu Note Added: 70680
2022-07-01 17:11 DenisChenu Assigned To DenisChenu =>
2022-07-05 12:27 LimeBot Note Added: 70706
2022-07-05 12:27 LimeBot Status ready for testing => closed
2022-07-05 12:27 LimeBot Bug heat 4 => 6
2022-07-05 12:32 DenisChenu Changeset attached => LimeSurvey 3.x-LTS 67059e8d
2022-07-05 12:32 DenisChenu Note Added: 70711
2022-07-05 12:32 DenisChenu Assigned To => DenisChenu