Drek282 / PsychoStats

This is an update to Stormtrooper's PsychoStats to fix obsolete and deprecated code as well as fix as many issues as possible and add support for games that interest me.
GNU General Public License v3.0
24 stars 10 forks source link

Installation Aborted! #76

Closed bobl61 closed 1 year ago

bobl61 commented 1 year ago

I have tried installing PsychoStats 3.2.7b, but to no avail. The error message is: "Installation Aborted! The installation was halted due to your session either timing out or another installation session was started! You must start over and try again. Be sure not to open a second installation window or it will fail again." I'm trying to install on a fully functional server: Xampp - Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.4.16. I have tried it on 2 different browsers (Edge and Chrome). I have cleared cookies. I have started the install process numerous times with the same result.

Drek282 commented 1 year ago

Please try 3.2.8b from the repo. Top left "Code" link. Click on green "Code" in the upper right. Choose "Download Zip". Please read the README and INSTALL documents. You will need to download the support for the game separately.

bobl61 commented 1 year ago

The installer will guide you through the setup process of installing PsychoStats 3.2.8b on your computer. Javascript and cookies must be enabled in your browser for the installer to work properly. Installation Aborted! The installation was halted due to your session either timing out or another installation session was started! You must start over and try again. Be sure not to open a second installation window or it will fail again.

Drek282 commented 1 year ago

What browser are you using? Can you do me a favour and try a different browser? The other question I have is, are you hosting this on a domain, or an IP address? That shouldn't make a difference, but you could try placing it in a subfolder (ie. [URL]/[folder]/). I typically install in a subfolder and I have received reports of the installation failing if it is in the domain root.

bobl61 commented 1 year ago

I tried on 2 browsers (Edge and Chrome). I have Dynamic DNS pointing to the server. http://psycho.servegame.com/ The upload dir is in a folder called stats. I have the root dir in the main xampp dir.

Drek282 commented 1 year ago

The contents of the "root" folder should be somewhere in a folder not accessible to the web. The contents of the "www" folder should be either in the root folder accessed by the URL "http://psycho.servegame.com/" or in a subfolder in that root folder, example: "http://psycho.servegame.com/stats/". Your use of the word "upload" makes me wonder if you are actually using version 3.2.8b. What used to be called "upload" is now the "www" folder.

Is there a chance that you've accidentally mixed the 3.2.8b files with an older version of PS?

bobl61 commented 1 year ago

I deleted all the old files before uploading 3.2.8b files. I tried installing without editing config.php and stats.php. I tried with adding the database info into config.php and stats.php.

2023-04-16_124420 2023-04-16_124457

Drek282 commented 1 year ago

It looks like you haven't uploaded the game/mod specific files to your "www" folder. Please read the INSTALL file, the version of that file included with 3.2.8b. You are missing a lot of files in your "stats" folder.

bobl61 commented 1 year ago

All the files are there... 2023-04-16_131203

Drek282 commented 1 year ago

Can you post the url you are using to access the stats please?

Drek282 commented 1 year ago

I think this is unrelated to your error, but there was an error in "install/mysql/defaults.sql". You will need to download that file and replace the version you are currently using. This is in the main repo, not the game module repo.

Once that error was fixed I was able to successfully complete the install. But again, please post the full URL you are using to install your stats.

Drek282 commented 1 year ago

Ok, I've put in a call for some help on this. I would ask one more thing. If you aren't hosting anything else on that URL, can you please try moving PS to the root web folder (taking it out of stats), and try to run the install again. I know the friend that was working with me on this experienced that same error. He was also running XAMPP, but he had PS installed in the web root folder.

Drek282 commented 1 year ago

Ok, I think the problem is probably in your config.php. Your config.php file should look as the following:

$dbtype = 'mysql'; $dbhost = 'localhost'; $dbport = ''; $dbname = '[your database name]'; $dbuser = '[your database user]'; $dbpass = '[your database password]'; $dbtblprefix = 'ps_'; $site_url = '';

You need to create a database for PsychoStats before you run the install, the install will not do that for you. You need to create a database user and grant that user full permissions on that database, again, before you run the install. That database user also needs to have a password.

I seem to recall that when my friend was experiencing that error it was due to the fact that he had not created a database before he ran the install. The install instructions used to say that the install process would create the database for you if you did not create one. If it ever worked that way, it no longer does.

Drek282 commented 1 year ago

I've improved the error message to make it more specific and informative. The file that has changed is "www/install/themes/default/index.html".

Drek282 commented 1 year ago

Having said that, even when I deleted the database I was unable to recreate the error. But that may be because I am running on Linux, not Windows.

Drek282 commented 1 year ago

Did you create a specific database and user for PS, grant the permissions etc.? It may be that PS won't work with the MySQL super user.

bobl61 commented 1 year ago

I'll create a new user for PS and see if that works.

Drek282 commented 1 year ago

If these stats were going to be production, and not just for closed testing, you should never use the MySQL superuser, regardless.

bobl61 commented 1 year ago

Okay, I created a new user and gave database specific full privileges to PS database. I edited config.php with new info and now I'm getting this: "Installation Aborted! The most likely cause for this error is that you have not created a database and database user for PsychoStats and/or entered your database name, database username and database user password into the config.php file. You need to create a database and a database user, and give that user full permissions on that database. The other possible reason for this error is that your session either timed out or another installation session was started. If that was the case you must start over and try again. Make sure you start the installation from the beginning and do not use your back button to attemp to restart the installation. Make sure you do not open a second installation window or it will fail again."

Drek282 commented 1 year ago

Well, I'm stumped. I don't know why you are getting that error, and I can't recreate it. My guess is it has something to do with the way XAMPP does things, but I have no experience with XAMPP. Or perhaps it's a Windows specific issue. I'm sorry but I've shot my bolt.

bobl61 commented 1 year ago

I hear ya' bro. We gave it a shot.

Rosenstein commented 1 year ago
Installation Aborted!
The installation was halted due to your session either timing out or another installation session was started! You must start over and try again. Be sure not to open a second installation window or it will fail again.

Error is displayed when you clear cookies during the installation. Are you sure you have cookies enabled? Maybe you have system wide block on cookies, or perhaps some browser extension is blocking the cookie. Since Edge is now based on Chrome, I'm suspecting you have same extension in both browsers. Try opening install folder from your mobile phone.

Also XAMPP is not meant for production use but only for development environments (not accessible from the internet) , if you didn't already, please harden that XAMPP installation. https://www.apachefriends.org/faq_windows.html#:~:text=Is%20XAMPP%20production%20ready%3F

bobl61 commented 1 year ago

Tried installing it on my phone (android). Exact same error message. Not sure if this is related to the problem I'm having, but when I manually tried to import the database tables (default.sql) I get this: Error MySQL said: Documentation

1146 - Table 'psychostats3_1.ps_config' doesn't exist

If I use basic.sql it imports with no errors. I also added my url to allow all cookies: 2023-04-18_205634

PS: I have 2 sites running with no issues on the same machine: "http://ggturbo.ddns.net/" "http://q3eplus.servequake.com/"

Drek282 commented 1 year ago

The PHP should do that for you. You don't need to do that. Again, I'm stumped, I have no idea, other than what I've already said, what is causing this error. I'm unable to recreate it.

bobl61 commented 1 year ago

giphy

Rosenstein commented 1 year ago

Did you change some cookie related settings in Apache/PHP configs? Please, upload "install" folder again.

Rosenstein commented 1 year ago

Yeah, something is borked with Apache or PHP. PHP script can't set the session cookie. Check the logs. image

Rosenstein commented 1 year ago

And change this line https://github.com/Drek282/PsychoStats/blob/main/www/install/common.php#L32 to

error_reporting(E_ALL); 
bobl61 commented 1 year ago

edit by Drek282: link removed

Rosenstein commented 1 year ago

Is there anything in Apache logs?

bobl61 commented 1 year ago

edit by Drek282: link removed

bobl61 commented 1 year ago

I uploaded the install folder again and changed the common.php file.

Rosenstein commented 1 year ago

You can edit comments and remove links for security, i will send logs to Drek.

Drek282 commented 1 year ago

I was so happy you were taking care of this...

I've downloaded the error.log. :(

Drek282 commented 1 year ago

This is all through the logs:

server certificate does NOT include an ID which matches the server name

That might well be screwing up your session key, which would be the cause of that error. In other words, Apache isn't configured properly.

Rosenstein commented 1 year ago

We need to troubleshoot this further. Follow this guide - https://medium.com/anditb/set-up-a-cookie-in-apache-with-php-43ff4437fc8a Step 2 and step 3, just so we can see if other scripts can create cookie. Create those files in "install" folder, so we can see if other script can create a cookie.

Drek282 commented 1 year ago

I'm going to look at those PHP errors when I have a minute or two. It might not be today.

Rosenstein commented 1 year ago

"http://psycho.servegame.com/install/coockieset.php"

"http://psycho.servegame.com/install/coockieset.html"

Change html to php

bobl61 commented 1 year ago

"http://psycho.servegame.com/install/coockieaccess.php"

Drek282 commented 1 year ago

Ok the first thing I saw when I looked at your php error.log was this:

PHP Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in C:\\xampp\\htdocs\\psycho.servegame.com\\stats\\install\\common.php:33\nStack trace:\n#0 C:\\xampp\\htdocs\\psycho.servegame.com\\stats\\install\\index.php(25): require_once()\n#1 {main}\n thrown in C:\\xampp\\htdocs\\psycho.servegame.com\\stats\\install\\common.php on line 33

If you didn't uncomment that line yourself for some unknown reason that immediately tells me that you are not running the latest version, PsychoStats 3.2.8.b from the repo, because that line has been commented out in the latest PsychoStats. In fact it is commented out in every version going back to 3.2.2b, the last version that Stormtrooper released back in 2008(?). So I don't know what version of PsychoStats you are running @bobl61 but it isn't the latest version available from this repo.

Please follow these instructions.

  1. Delete all the files and folders from your web folder and wherever you put the stats.pl script, except stats.cfg and config.php.
  2. Click on the "Code" link in the upper left of this repository.
  3. Click on the green "Code" button in the upper right of that page.
  4. Click on "Download Zip".
  5. Extract the resulting file somewhere and follow the instructions in INSTALL.md, to the letter please, and try again.
Drek282 commented 1 year ago

Just to be sure I checked the second error in that file, and it also dates to version 3.2.2b. So @bobl61 once you are actually running the latest 3.2.8b from this repository, please report back here.

Drek282 commented 1 year ago

I'm closing this for now. This is clearly not a problem with 3.2.8b. Please feel free report another issue if you still experience problems when you are using the latest version from this repository.

huobage commented 1 year ago

I encountered the same error, also follow the tutorial steps to install is also a stop error My system is centos7 The database configuration is set according to the process or the installation is terminated! PS: SQL: mysql5.6 maridb10.5 http component: Apache Nginx PHP components: 7.4 8.2 All of the above have been tested, but the installation is still terminated to no avail. I predict that the author's system environment is different and the above problems cannot be tested. 屏幕截图 2023-06-02 122751

Rosenstein commented 1 year ago

https://github.com/Drek282/PsychoStats/blob/016876e6c12b439985767c6ec0a76260ff829b95/www/includes/class_session.php#L76 Change value to 0 as a temp fix.

huobage commented 1 year ago

Thanks a lot, problem solved!

Drek282 commented 1 year ago

@huobage Are you also using SSL? Do you have a valid certificate for your domain?

huobage commented 1 year ago

@Drek282 I am using the latest 3.2.8b, the local LAN test environment, not using SSL. I would like to ask a question, the background log FTP transmission method, how to fill in the path column. 屏幕截图 2023-06-02 191221

Drek282 commented 1 year ago

Log Path should be the path relative to your ftp root. If your ftp root is the actual logs folder that Log Path should be empty.

Drek282 commented 1 year ago

@huobage can you post the url you are using to install your stats?

huobage commented 1 year ago

@Drek282 I didn't fully understand what you meant, I used google translate. My test environment is an internal network, do you need a url for intranet access?

Drek282 commented 1 year ago

Just send me the url you use to access your stats. I'm not trying to access your stats, I just want to look at that url.

example: http://192.168.0.104/