Generating Tokens

More
1 year 10 months ago #173744 by terryaulenbach
Version 3.14.7+180827

This is likely a bug, but I'll ask here first in case I'm missing something obvious.
I initiated the participant table and then tried to generate tokens. I've tried this with 2 different surveys with the same result.

I get a similar message depending on how many participants are in the table:

Create tokens
Only 0 tokens have been created.Need 2 tokens.

I'm not sure what I could be missing.

Terry
The topic has been locked.
LimeSurvey Partners
More
1 year 10 months ago #173747 by terryaulenbach
Replied by terryaulenbach on topic Generating Tokens
Sorry, I should have mentioned that in each case participants had already been created.

Terry
The topic has been locked.
More
1 year 10 months ago #173759 by terryaulenbach
Replied by terryaulenbach on topic Generating Tokens
Well, this might be related. I just went to create a couple dummy participants to see if those tokens would be created and I got this error (BTW we're using PostgreSQL - this seems to be more of a problem with 3.x):


500: Internal Server Error
Something is wrong with your random generator.

An internal error occurred while the Web server was processing your request.

Please contact Administrator to report this problem.
The topic has been locked.
More
1 year 10 months ago #173764 by DenisChenu
Replied by DenisChenu on topic Generating Tokens
Do you have a "token length" set in this survey ? Maybe set it to 0 broke generation.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The topic has been locked.
More
1 year 10 months ago #173765 by terryaulenbach
Replied by terryaulenbach on topic Generating Tokens
Yes, I've tried 15 and 16.

Terry
The topic has been locked.
More
1 year 10 months ago #173768 by DenisChenu
Replied by DenisChenu on topic Generating Tokens
Then : « Something is wrong with your random generator.» …

Activate debug mode, save phpinfo file, get all information from your server and report a complete issue.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The topic has been locked.
More
1 year 10 months ago #173790 by terryaulenbach
Replied by terryaulenbach on topic Generating Tokens
I tried to submit a bug report, but there's no option for selecting 3.14x.

Attached is the error page that comes up. The problem seems to centre around LSYii generating the tokens.

Terry


This browser does not support PDFs. Please download the PDF to view it: Download PDF

Attachments:
The topic has been locked.
More
1 year 10 months ago #173803 by DenisChenu
Replied by DenisChenu on topic Generating Tokens

jelo wrote:

terryaulenbach wrote: I tried to submit a bug report, but there's no option for selecting 3.14x.

Leave the version empty. They are a bit late updating the version drop down list ;-)

+1 :)

And send directly the saved html file, no need a pdf export.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The topic has been locked.
More
1 year 10 months ago - 1 year 10 months ago #174590 by combitz
Replied by combitz on topic Generating Tokens
Hi All,

I'm experiencing the same problem on Version 3.14.10+180924 with PHP 7.2.10 on IIS10 via Fast Cgi and MSSQL via driver php_pdo_sqlsrv_72_nts_x64.dll

Viewing Survey participants and using the menu (Create dummy participants) as the original ops screen grab, I get the same error. If I switch the value to zero for number of participants I get a success message but obviously no tokens are created.

Any value above 0 shows the error however it does create a single blank participant if there are no empty token records. Clicking the Generate Tokens button and confirming "yes" returns "Created Tokens Only 0 tokens have been created.Need 1 token."

I can manually edit the participants but it is just not viable as we currently use LimeSurveys v1 and generate tokens for a survey which are then used to store against our own participant records. Currently this issue is stopping us from moving to the new version which we would really like to do :(

I am new to Lime Surveys really so I have no idea how to report the error to you however it does not log anything in iis, php or sys.event logs which is frustrating and my php is set to error_reporting = E_ALL and display_errors is on.

Any help appreciated.

Thanks
Last edit: 1 year 10 months ago by combitz. Reason: more detail on env
The topic has been locked.
More
1 year 10 months ago #174594 by combitz
Replied by combitz on topic Generating Tokens
Okay so I've found the debug mode :D
I've not found a proper solution yet but the problem looks to be "application\models\Token.php"

public static function generateRandomToken($iTokenLength)
{
return str_replace(array('~', '_'), array('a', 'z'), Yii::app()->securityManager->generateRandomString($iTokenLength));
}

This is failing (not sure why yet) but replacing the code with another random string generator allows it to work fine and I get tokens so I'll try to look into Yii more as I've never used that framework.
The topic has been locked.
More
1 year 10 months ago #174596 by combitz
Replied by combitz on topic Generating Tokens
The problem is PHP 7.2 deprecated the mcrypt method so Yii::app()->securityManager->generateRandomString(int) will always fail on PHP installs above 7.1
The topic has been locked.
More
1 year 10 months ago #174601 by combitz
Replied by combitz on topic Generating Tokens
Thanks jelo,

Didn't see your reply earlier in the thread, thanks for the openssl info.
The topic has been locked.
More
1 year 10 months ago #174614 by DenisChenu
Replied by DenisChenu on topic Generating Tokens

jelo wrote: …
Yii checks if OpenSSL or MCrypt or /dev/urandom is available. On a Windows platform under PHP 7.2 both MCrypt (not available under PHP 7.2 or above) and /dev/unrandom (not available under windows) are not available. So OpenSSL is the only way under Windows PHP 7.2.

Maybe we need to test it when installing ? And show a warning (like imap etc …) or a danger

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The topic has been locked.
More
1 year 10 months ago #174619 by combitz
Replied by combitz on topic Generating Tokens

DenisChenu wrote: Maybe we need to test it when installing ? And show a warning (like imap etc …) or a danger


I just had the same thought as it will get everyone installing from new as 7.2+ is the current recommended stable version going forward.

Thanks for the help, tokens working now :)
The topic has been locked.
More
1 year 10 months ago #174638 by DenisChenu
Replied by DenisChenu on topic Generating Tokens

combitz wrote: I just had the same thought as it will get everyone installing from new as 7.2+ is the current recommended stable version …

Yes but we don't recommend Windows IIS ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The topic has been locked.

Start now!

Just create your account and start using Limesurvey today.

Register now