View Issue Details

IDProjectCategoryView StatusLast Update
14055Bug reports[All Projects] Central participant databasepublic2018-09-26 14:14
ReporterterryaulenbachAssigned Tomarkusfluer 
PriorityurgentSeveritymajor 
Status assignedResolutionreopened 
Product Version 
Target VersionFixed in Version 
Summary14055: 3.14x - can't generate tokens
Description

With PHP debug mode on...
When I attempt to generate tokens, I always receive the message:
Only 0 tokens have been created.Need X tokens (where X is the number I tried to generate).

If I try to create dummy participants I get the erros in the attached HTML file.

Steps To Reproduce

First situation:

  1. Create at least one participant
  2. Try to generate tokens

Second situation:

  1. Try to create any number of dummy participants
TagsNo tags attached.
Complete LimeSurvey version number (& build)3.14.7+180827
I will donate to the project if issue is resolvedNo
Browservarious browsers
Database & DB-VersionPostgreSQL 9.6.5 (win32) - but apparently the 64-bit version
Operating System (Server)Windows Server 2012 R2 Standard Edition
Webserver software & versionApache 2.4.33 (Win64)
PHP Version7.2.7 (x64)

Activities

terryaulenbach

terryaulenbach

2018-09-13 20:55

reporter  

Random Generator Exception.html (18,104 bytes)
dominikvitt

dominikvitt

2018-09-14 18:15

developer   ~49049

Token generator works as expected using the latest LimeSurvey version on my local installation and also on hosted installation.

I'm using Linux OS, so it may take some additional effort to make it work on Windows Server.
Generator relies on 2 libraries which need to be installed on your server to make it work:
openssl ( function openssl_random_pseudo_bytes )
mcrypt ( function mcrypt_create_iv )

Also you can try to upgrade to the latest version of LimeSurvey.

DenisChenu

DenisChenu

2018-09-14 19:26

developer   ~49051

This mean : Something is wrong with Windows Server 2012 R2 Standard Edition random generator … :D

jelo

jelo

2018-09-14 22:11

updater   ~49052

Why should Windows 2012 R2 be the issue?
Mcrypt is no longer part of PHP 7.2.
https://wiki.php.net/rfc/mcrypt-viking-funeral

Terry should use PHP 7.1.X. Mcrypt was deprecated under PHP 7.1, but is still there.

BTW: Against what PHP version is LimeSurvey tested during daily development?
demo.limesurvey.org is running 7.0.30-0ubuntu0.16.04.1.

PHP is now proposing LibSodium
https://paragonie.com/book/pecl-libsodium/read/00-intro.md#what-is-libsodium

jelo

jelo

2018-09-14 22:38

updater   ~49053

Just a follow up: LimeSurvey uses Yii to generate tokens.
Yii checks if OpenSSL or MCrypt or /dev/random is available.

if(function_exists('openssl_random_pseudo_bytes'))
if(function_exists('mcrypt_create_iv') &&
if(($file=@fopen('/dev/urandom','rb'))!==false &&

https://github.com/LimeSurvey/LimeSurvey/blob/master/framework/base/CSecurityManager.php#L391

Recommendation for LimeSurvey 3.X under PHP 7.2 for Windows is to activate OpenSSL extension.
Check php.ini for php_openssl.dll .

terryaulenbach

terryaulenbach

2018-09-17 17:55

reporter   ~49064

Thanks for the comments and suggestions. Enabling php_openssl.dll solved the problem.

Terry

DenisChenu

DenisChenu

2018-09-17 18:55

developer   ~49067

Must update manual + must add it in installer maybe

rbaier

rbaier

2018-09-18 10:44

reporter   ~49071

We cannot generate tokens in LS version 3.14.8+180829 (SLES 12). Attempt to generate tokens gives no error message and ends with displaying the list of surveys.
Creation of dummy participants works.
We will give LS version 3.14.9 a try.

rbaier

rbaier

2018-09-18 12:46

reporter   ~49072

Still impossible to generate tokens in LS version 3.14.9+180917.

jelo

jelo

2018-09-18 17:51

updater   ~49076

rbaier, you're on SLES12.
What PHP version is used? And PHPinfo would be helpful.

Flups22

Flups22

2018-09-19 14:42

reporter   ~49089

@jelo, rbaier and my installation runs with PHP 7.07.

rbaier

rbaier

2018-09-19 15:35

reporter   ~49091

@jelo, PHP version is 7.0.7
Especially what part of phpinfo output would be helpful? I'm not allowed to publish the whole stuff here.
With LS Version 3.14.9+180917 we cannot add a participant manually to the list. Nothing happens after clicking the "Save" button.
But adding "Dummy Participants" is still working.

jelo

jelo

2018-09-20 00:26

updater   ~49096

@rbaier: If you can add Dummy Participants, than your issue is not scope of this bugticket.
That would be a different bug. https://bugs.limesurvey.org/view.php?id=14081

jelo

jelo

2018-09-20 00:28

updater   ~49097

Ticket can be closed, but a warning for php 7.2 under windows will be helpful, when OpenSSL is not available.
Yii will need it, to generate the token. Under Linux /dev/urandom will be availble, but Windows isn't offering it.
So OpenSSL is a requirement for PHP 7.2, if Yii routines stay the same.

rbaier

rbaier

2018-09-26 11:49

reporter   ~49130

@jelo, The bug "14081: Save button on the "Add participants" window not working." has been resolved. We have tried out the two patched files and it worked.
application/controllers/admin/tokens.php
application/views/admin/token/tokenform.php

But the issue "can't generate tokens" by using the "Generate tokens" button is still unresolved, also in LS Version 3.14.10+180924
We can add Dummy Participants, edit and save participant entries.

markusfluer

markusfluer

2018-09-26 12:18

manager   ~49131

Last edited: 2018-09-26 12:18

View 2 revisions

@rbaier We would need the php version as well as if openssl, repectively libsodium is available.

markusfluer

markusfluer

2018-09-26 12:20

manager   ~49132

@jelo daily developement is on each developers machine with a slightly different set of software, but mostly nginx + mysql + php > 7
And since this week we also regularly test on windows server 2016.

jelo

jelo

2018-09-26 13:51

updater   ~49136

@markusfluer: rbaier uses SLES 12. I'm not sure if they backport certain things (php 7.0.7 is from 26 May 2016). I'm not using SLES, but PHP 7.0.7 would offer Yii openssl, mcrypt and /dev/urandom. Looks to me like a different kind of bug for users of PHP 7.0.7 under SLES.
Certain things were fixed in OpenSSL after PHP 7.0.7. http://php.net/ChangeLog-7.php#7.0.7

rbaier

rbaier

2018-09-26 14:14

reporter   ~49138

@markusfluer PHP 7.0.7 under SLES 12 SP3.
openssl is available:
php7-openssl-7.0.7-50.49.1.x86_64
libopenssl1_0_0-1.0.2j-60.30.1.x86_64
libopenssl1_0_0-32bit-1.0.2j-60.30.1.x86_64
openssl-1.0.2j-60.30.1.x86_64

Issue History

Date Modified Username Field Change
2018-09-13 20:55 terryaulenbach New Issue
2018-09-13 20:55 terryaulenbach File Added: Random Generator Exception.html
2018-09-14 11:45 LouisGac Sticky Issue No => Yes
2018-09-14 18:15 dominikvitt Assigned To => dominikvitt
2018-09-14 18:15 dominikvitt Status new => resolved
2018-09-14 18:15 dominikvitt Resolution open => unable to reproduce
2018-09-14 18:15 dominikvitt Note Added: 49049
2018-09-14 19:26 DenisChenu Note Added: 49051
2018-09-14 22:11 jelo Note Added: 49052
2018-09-14 22:38 jelo Note Added: 49053
2018-09-17 15:47 LouisGac Sticky Issue Yes => No
2018-09-17 17:55 terryaulenbach Note Added: 49064
2018-09-17 18:55 DenisChenu Assigned To dominikvitt =>
2018-09-17 18:55 DenisChenu Status resolved => feedback
2018-09-17 18:55 DenisChenu Resolution unable to reproduce => reopened
2018-09-17 18:55 DenisChenu Note Added: 49067
2018-09-18 10:44 rbaier Note Added: 49071
2018-09-18 12:46 rbaier Note Added: 49072
2018-09-18 17:51 jelo Note Added: 49076
2018-09-19 09:10 c_schmitz Assigned To => markusfluer
2018-09-19 09:10 c_schmitz Status feedback => assigned
2018-09-19 09:10 c_schmitz Priority none => urgent
2018-09-19 14:42 Flups22 Note Added: 49089
2018-09-19 15:35 rbaier Note Added: 49091
2018-09-20 00:26 jelo Note Added: 49096
2018-09-20 00:28 jelo Note Added: 49097
2018-09-26 11:49 rbaier Note Added: 49130
2018-09-26 12:18 markusfluer Note Added: 49131
2018-09-26 12:18 markusfluer Note Edited: 49131 View Revisions
2018-09-26 12:20 markusfluer Note Added: 49132
2018-09-26 13:51 jelo Note Added: 49136
2018-09-26 14:14 rbaier Note Added: 49138