Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error on installation #184

Open
smintiens opened this issue Dec 8, 2016 · 7 comments
Open

Fatal error on installation #184

smintiens opened this issue Dec 8, 2016 · 7 comments

Comments

@smintiens
Copy link

Im getting the following error when running the install.php file. I've gotten this error using a sql user with grant all as well as root.

Creating core tables...
OK — coaches
OK — teams
OK — players
OK — memberships
OK — players_skills
OK — races
OK — leagues
OK — divisions
OK — tours
OK — matches
OK — match_data
OK — texts
OK — game_data_players
OK — game_data_stars
OK — game_data_skills
OK — mv_players
OK — mv_teams
OK — mv_coaches
OK — mv_races
OK — mv_es_players
OK — mv_es_teams
OK — mv_es_coaches
OK — mv_es_races
OK — match_data_es
Creating module tables...
OK — wanted
OK — hof
OK — prizes
OK — log
OK — conferences
OK — conference_teams
OK — league_prefs
OK — cemetery
OK — famousteams
Other tasks...
OK — Synchronize game data with database
OK — applied table indexes

FATAL ERROR: One or more OBBLM MySQL functions/procedures could not be created. This error is most likely due to your database user NOT having the "CREATE ROUTINE" privilege. Some web hosts are willing to help you work around this problem by running this install/upgrade script for you. If not, you will have to find another web host allowing "CREATE ROUTINE".

MySQL error (errno 1064):
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; SELECT game_data_players.ma, game_data_players.s' at line 45

The function/procedure SQL code that failed was:
CREATE PROCEDURE getPlayerDProps( IN pid MEDIUMINT SIGNED, OUT inj_ma TINYINT UNSIGNED, OUT inj_av TINYINT UNSIGNED, OUT inj_ag TINYINT UNSIGNED, OUT inj_st TINYINT UNSIGNED, OUT inj_ni TINYINT UNSIGNED, OUT ma TINYINT UNSIGNED, OUT av TINYINT UNSIGNED, OUT ag TINYINT UNSIGNED, OUT st TINYINT UNSIGNED, OUT ma_ua TINYINT SIGNED, OUT av_ua TINYINT SIGNED, OUT ag_ua TINYINT SIGNED, OUT st_ua TINYINT SIGNED, OUT value MEDIUMINT SIGNED, OUT status TINYINT UNSIGNED, OUT date_died DATETIME ) NOT DETERMINISTIC READS SQL DATA BEGIN DECLARE ach_ma,ach_st,ach_ag,ach_av, def_ma,def_st,def_ag,def_av TINYINT UNSIGNED DEFAULT 0; DECLARE cnt_skills_norm, cnt_skills_doub TINYINT UNSIGNED; DECLARE extra_val MEDIUMINT SIGNED; DECLARE f_pos_id SMALLINT UNSIGNED; SELECT players.f_pos_id, players.extra_val, players.ach_ma, players.ach_st, players.ach_ag, players.ach_av INTO f_pos_id, extra_val, ach_ma, ach_st, ach_ag, ach_av FROM players WHERE player_id = pid; SET cnt_skills_norm = (SELECT COUNT() FROM players_skills WHERE f_pid = pid AND type = "N"); SET cnt_skills_doub = (SELECT COUNT() FROM players_skills WHERE f_pid = pid AND type = "D"); SELECT IFNULL(SUM(IF(inj = 3, 1, 0) + IF(agn1 = 3, 1, 0) + IF(agn2 = 3, 1, 0)), 0), IFNULL(SUM(IF(inj = 4, 1, 0) + IF(agn1 = 4, 1, 0) + IF(agn2 = 4, 1, 0)), 0), IFNULL(SUM(IF(inj = 5, 1, 0) + IF(agn1 = 5, 1, 0) + IF(agn2 = 5, 1, 0)), 0), IFNULL(SUM(IF(inj = 6, 1, 0) + IF(agn1 = 6, 1, 0) + IF(agn2 = 6, 1, 0)), 0), IFNULL(SUM(IF(inj = 7, 1, 0) + IF(agn1 = 7, 1, 0) + IF(agn2 = 7, 1, 0)), 0) INTO inj_ni,inj_ma,inj_av,inj_ag,inj_st FROM match_data WHERE f_player_id = pid; SET value = (SELECT cost FROM game_data_players WHERE game_data_players.pos_id = f_pos_id) + (ach_ma + ach_av) * 30000 + ach_ag * 40000 + ach_st * 50000 + cnt_skills_norm * 20000 + cnt_skills_doub * 30000 + extra_val - inj_ma * - inj_av * - inj_ag * - inj_st * ; SELECT game_data_players.ma, game_data_players.st, game_data_players.ag, game_data_players.av INTO def_ma,def_st,def_ag,def_av FROM game_data_players WHERE game_data_players.pos_id = f_pos_id; SET ma_ua = CONVERT(ach_ma + def_ma,SIGNED) - CONVERT(inj_ma,SIGNED); SET st_ua = CONVERT(ach_st + def_st,SIGNED) - CONVERT(inj_st,SIGNED); SET ag_ua = CONVERT(ach_ag + def_ag,SIGNED) - CONVERT(inj_ag,SIGNED); SET av_ua = CONVERT(ach_av + def_av,SIGNED) - CONVERT(inj_av,SIGNED); SET ma = calcEffectiveChr(def_ma, ma_ua); SET st = calcEffectiveChr(def_st, st_ua); SET ag = calcEffectiveChr(def_ag, ag_ua); SET av = calcEffectiveChr(def_av, av_ua); SET status = getPlayerStatus(pid, -1); IF status = 8 THEN SET date_died = (SELECT date_played FROM matches, match_data WHERE f_match_id = match_id AND f_player_id = pid AND inj = 8); ELSE SET date_died = NULL; END IF; END

@smintiens
Copy link
Author

I got this error when trying to install after git cloning the working repo. When I installed from the 1.0 release, it installed without problems. Potential SQL error in the current working version though.

@kirreen
Copy link

kirreen commented Dec 19, 2016

I get the same error, and using 1.0 fixed it.

@Halfnir
Copy link

Halfnir commented Jan 23, 2017

Got the same error when installing current branch on XAMPP with default PHP Verion (5.6.28)

found the following in the documentation: https://dev.mysql.com/doc/refman/5.7/en/stored-programs-logging.html
After adding the following line found in above documentation to the "my.ini" file, installation worked fine.
log-bin-trust-function-creators=1
But i think it would be better to rewise above mentioned SQL procedure.

Before that I also got a fatal error due to a PHP execution timeout, had to change the following value in php.ini from 30 to higher value (e.g. 120).

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time=120

I think install.php should use the http://php.net/manual/de/function.set-time-limit.php command to extend the timelimit. Same for the upgrade procedure after the first login the root user.

@mfranchetti
Copy link

Possible bug in current development code - needs to be checked.

@Indigogyre
Copy link

Hello,

PHP version 5.3
mySql version 5.6
Unix hosting platform.

I checked with my hosting company and they verified that I should have the proper access required to run this. I've installed an older version in the past and that is up and running. This was to be a completely new install.

I downloaded the naflm 1.0 install and the following error was generated.

FATAL ERROR: One or more OBBLM MySQL functions/procedures could not be created. This error is most likely due to your database user NOT having the "CREATE ROUTINE" privilege. Some web hosts are willing to help you work around this problem by running this install/upgrade script for you. If not, you will have to find another web host allowing "CREATE ROUTINE".

MySQL error (errno 1419):
You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)

The function/procedure SQL code that failed was:
CREATE FUNCTION getPlayerStatus(pid MEDIUMINT SIGNED, mid MEDIUMINT SIGNED) RETURNS TINYINT UNSIGNED NOT DETERMINISTIC READS SQL DATA BEGIN DECLARE status TINYINT UNSIGNED DEFAULT NULL; IF !EXISTS(SELECT f_match_id FROM match_data WHERE f_player_id = pid LIMIT 1) THEN RETURN 1; END IF; IF mid = -1 OR EXISTS(SELECT match_id FROM matches WHERE match_id = mid AND date_played IS NULL) THEN SELECT inj INTO status FROM match_data, matches WHERE f_player_id = pid AND match_id = f_match_id AND date_played IS NOT NULL ORDER BY date_played DESC LIMIT 1; ELSE SELECT inj INTO status FROM match_data, matches WHERE match_data.f_player_id = pid AND matches.match_id = match_data.f_match_id AND matches.date_played IS NOT NULL AND matches.date_played < (SELECT date_played FROM matches WHERE matches.match_id = mid) ORDER BY date_played DESC LIMIT 1; END IF; RETURN IF(status IS NULL, 1, status); END

Can anyone help?

@thefloppy1
Copy link
Collaborator

thefloppy1 commented Nov 18, 2018 via email

@Indigogyre
Copy link

My account has the following permissions which are enough to create everything to my knowledge.

"GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER ON Database.* TO 'User'@'%' WITH GRANT OPTION"

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants