• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Invalid FOG/MySQL Password Character: ";"

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    4
    39
    13.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      christopherJames @Tom Elliott
      last edited by

      @Tom-Elliott said:

      What version of FOG are you running?

      1.2.0

      Can you change this so it only is defined using single quote, or escape the string more properly?

      Yes, I can and will. How’s

      +-P0ck3t.M0nst3r+-
      

      for a test password?

      I’ve tested with the ; in the MySQL password and it is working fine on my system. Now if your password is literally ';SomeStrange0129Password!' there could be some issues involved as I’m just not that good at escaping quite yet. However, just the simple ; in the password doesn’t seem to pose a direct issue.

      My password string was literally:

      ‘;Mich43l’;

      and if memory serves it looked like this in the config file:

      define( “MYSQL_PASSWORD”, “';Mich43l';” );
      

      I’ll reproduce tonight and post the exact output of the log file but please be patient with me. I’m slowly learning my way around Linux based systems and could have been COMPLETELY misinterpreting the error.

      Cheers

      Tom ElliottT 1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott @christopherJames
        last edited by

        @christopherJames I’d actually recommend, if possible, using the dreaded semicolon. I’ll see what I can do about escaping the actual password directly, though escaping for bash is MUCH different than escaping for php.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        C Wayne WorkmanW 2 Replies Last reply Reply Quote 0
        • george1421G
          george1421 Moderator
          last edited by

          Ugh, its much worse than the dreaded semicolon.

          define( “MYSQL_PASSWORD”, “';Mich43l';” );
          

          He’s also got the dreaded single quote/double quote mixture which should have driven php crazy, and then throw in that extra pair of semicolons, no wonder FOG tossed its cookies.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          1 Reply Last reply Reply Quote 0
          • C
            christopherJames @Tom Elliott
            last edited by

            @Tom-Elliott

            OK, I set it back up the way it was last night:

            From /var/www/fog/lib/fog/Config.class.php

            		define('DATABASE_TYPE',		'mysql');	// mysql or oracle
            		define('DATABASE_HOST',		'localhost');
            		define('DATABASE_NAME',		'fog');
            		define('DATABASE_USERNAME',		'root');
            		define('DATABASE_PASSWORD',		'';Mich43l';');
            

            The editor even thinks the ;'s are terminators, look at the color formatting of the password.

            0_1455666364043_InvalidPasswordChars.png

            From /var/log/apache2/error.log:

            [Tue Feb 16 07:37:03.775513 2016] [mpm_prefork:notice] [pid 9479] AH00163: Apache/2.4.12 (Ubuntu) configured – resuming normal operations
            [Tue Feb 16 07:37:03.775586 2016] [core:notice] [pid 9479] AH00094: Command line: ‘/usr/sbin/apache2’
            [Tue Feb 16 18:27:55.164487 2016] [mpm_prefork:notice] [pid 9479] AH00169: caught SIGTERM, shutting down
            [Tue Feb 16 18:27:56.370153 2016] [mpm_prefork:notice] [pid 14244] AH00163: Apache/2.4.12 (Ubuntu) configured – resuming normal operations
            [Tue Feb 16 18:27:56.370286 2016] [core:notice] [pid 14244] AH00094: Command line: ‘/usr/sbin/apache2’
            [Tue Feb 16 18:28:29.984279 2016] [:error] [pid 14247] [client 192.168.1.101:36350] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32
            [Tue Feb 16 18:28:37.840495 2016] [:error] [pid 14248] [client 192.168.1.101:36352] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:28:40.093808 2016] [:error] [pid 14249] [client 192.168.1.101:36354] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:28:40.648723 2016] [:error] [pid 14250] [client 192.168.1.101:36356] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:28:41.766683 2016] [:error] [pid 14251] [client 192.168.1.101:36358] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:32:06.560824 2016] [mpm_prefork:notice] [pid 14244] AH00169: caught SIGTERM, shutting down
            [Tue Feb 16 18:32:52.152509 2016] [mpm_prefork:notice] [pid 1268] AH00163: Apache/2.4.12 (Ubuntu) configured – resuming normal operations
            [Tue Feb 16 18:32:52.160009 2016] [core:notice] [pid 1268] AH00094: Command line: ‘/usr/sbin/apache2’
            [Tue Feb 16 18:39:09.209332 2016] [:error] [pid 1271] [client 192.168.1.101:49018] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:39:09.549352 2016] [:error] [pid 1272] [client 192.168.1.101:49020] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:39:10.136049 2016] [:error] [pid 1273] [client 192.168.1.101:49022] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:39:12.343867 2016] [:error] [pid 1274] [client 192.168.1.101:49024] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:39:12.924029 2016] [:error] [pid 1275] [client 192.168.1.101:49026] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/
            [Tue Feb 16 18:39:13.527040 2016] [:error] [pid 1271] [client 192.168.1.101:49028] PHP Parse error: syntax error, unexpected ‘;’ in /var/www/fog/lib/fog/Config.class.php on line 32, referer: http://192.168.1.101/

            C 1 Reply Last reply Reply Quote 0
            • C
              christopherJames @christopherJames
              last edited by

              And if anyone is feeling especially helpful tonight… I’m now getting this error in /va/log/apache2/error.log when I try to go to the management screen:

              PHP Fatal error:  Call to a member function query() on null in /var/www/fog/lib/db/MySQL.class.php
              

              Line 89 from /var/www/fog/lib/db/MySQL.class.php is:

              $this->queryResult = $this->link->query($this->query) or $GLOBALS['FOGCore']->debug($this->sqlerror(),$this->query);
              

              0_1455668622268_FOG_MgmtScreenError.png

              Tom ElliottT 1 Reply Last reply Reply Quote 0
              • Tom ElliottT
                Tom Elliott @christopherJames
                last edited by

                @christopherJames if this is the same password as originally setup, the ; was not the problem. Instead it is the quotes themselves.

                I’m just guessing, also, that you reset the MySQL user password too. For your scenario, I’d request of you to escape the single quotes by preceding it with \ where the quotes are supposed to be in the actual password.

                It is the current setup of the pw that’s failing as it is broken and unable to connect to the db.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                C 1 Reply Last reply Reply Quote 0
                • george1421G
                  george1421 Moderator
                  last edited by george1421

                  I would suspect since you caused great confusion with the sql password and this error is around sql, that you are having issues access the database.

                  In regards to your error, you have a combination of errors in your password. What you entered for the database password was ‘;Mich43l’; which if you look at what you posted the code saw ‘’;Mich’;’ or a null string, some extra text and a semicolon as a password. A semicolon for sql is an end of command.

                  Can you log into the mysql utility to access the sql server at all? The password may be a single semicolon (??) If you can’t you will need to go through the process to reset the mysql password, update the .fogsettings file and then rerun the installer to fix everything.

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                  C 1 Reply Last reply Reply Quote 0
                  • Wayne WorkmanW
                    Wayne Workman @Tom Elliott
                    last edited by

                    @Tom-Elliott said:

                    @christopherJames I’d actually recommend, if possible, using the dreaded semicolon. I’ll see what I can do about escaping the actual password directly, though escaping for bash is MUCH different than escaping for php.

                    let’s do all things dealing with .fogsettings in PHP instead?

                    #!/usr/bin/php
                    or
                    php myscript.php

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    1 Reply Last reply Reply Quote 0
                    • C
                      christopherJames @Tom Elliott
                      last edited by

                      @Tom-Elliott said:

                      @christopherJames if this is the same password as originally setup, the ; was not the problem. Instead it is the quotes themselves.

                      I’m just guessing, also, that you reset the MySQL user password too. For your scenario, I’d request of you to escape the single quotes by preceding it with \ where the quotes are supposed to be in the actual password.

                      It is the current setup of the pw that’s failing as it is broken and unable to connect to the db.

                      Aaahhhhh, OK, now think I understand.

                      And no, I did not reset the MySQL password, the password in

                      /var/www/fog/lib/fog/Config.class.php

                      is the only one I’ve messed with since installation.

                      So if I’m understanding you correctly I changed it to this:

                      	define('DATABASE_PASSWORD',		'\';Mich43l\';');
                      

                      restarted the Apache server

                      sudo service apache2 restart
                      

                      But still no love from the management screen:

                      0_1455671616917_FOG_MgmtScreenError_2.png

                      0_1455671457798_EscapedCharacters.png

                      Tom ElliottT 1 Reply Last reply Reply Quote 0
                      • Tom ElliottT
                        Tom Elliott @christopherJames
                        last edited by

                        @christopherJames anything special in error logs?

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                        C 1 Reply Last reply Reply Quote 0
                        • C
                          christopherJames @george1421
                          last edited by

                          @george1421 said:

                          I would suspect since you caused great confusion with the sql password and this error is around sql, that you are having issues access the database.

                          In regards to your error, you have a combination of errors in your password. What you entered for the database password was ‘;Mich43l’; which if you look at what you posted the code saw ‘’;Mich’;’ or a null string, some extra text and a semicolon as a password. A semicolon for sql is an end of command.

                          Can you log into the mysql utility to access the sql server at all? The password may be a single semicolon (??) If you can’t you will need to go through the process to reset the mysql password, update the .fogsettings file and then rerun the installer to fix everything.

                          I JUST thought of the same thing, wondering if the MySQL database choked on the password and puked too, and tried this:

                          christopher@NUC001:/$ mysql --user=root --password=';Mich43l';
                          Warning: Using a password on the command line interface can be insecure.
                          ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
                          
                          christopher@NUC001:/$ mysql --user=root --password=;
                          Warning: Using a password on the command line interface can be insecure.
                          ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
                          
                          christopher@NUC001:/$ mysql --user=root --password='
                          > 
                          
                          george1421G Tom ElliottT 2 Replies Last reply Reply Quote 0
                          • C
                            christopherJames @Tom Elliott
                            last edited by

                            @Tom-Elliott said:

                            @christopherJames anything special in error logs?

                            Many many of these:

                            [Tue Feb 16 20:29:15.038672 2016] [:error] [pid 7261] [client 192.168.1.101:49802] PHP Fatal error:  Call to a member function query() on null in /var/www/fog/lib/db/MySQL.class.php on line 89, referer: http://192.168.1.101/
                            

                            0_1455672750738_error.log

                            Tom ElliottT 1 Reply Last reply Reply Quote 0
                            • george1421G
                              george1421 Moderator @christopherJames
                              last edited by george1421

                              @christopherJames I think the first / next thing you need to do is get control of your sql server. To do this you need to work through the process of resetting root’s password for mssql. Here is a guide to get you started. https://support.rackspace.com/how-to/mysql-resetting-a-lost-mysql-root-password/
                              Please don’t use any special characters in the password especially '?%"/#`

                              After you get the password reset ensure that you can login to mysql as root using mysql -u root then it will prompt you for the password. Now I’m going to suspect that nothing fog related is in the database. If you then issue the command show databases; you will see a list of databases in mysql. Either way just key in exit to leave the mysql console. Then move over to the .fogsettings file and update the database password with what you set the root password for mysql to. Then rerun the installer and hopefully it will recreate the missing mysql stuff.

                              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                              C 1 Reply Last reply Reply Quote 0
                              • Tom ElliottT
                                Tom Elliott @christopherJames
                                last edited by

                                @christopherJames can you try double escaping? Make the single quotes where needed in the password as \\'.

                                I’m suspecting the first one is close, but sql is the one needing the escape, not php at that point. The php is still sending the unescaped quote.

                                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                1 Reply Last reply Reply Quote 0
                                • Tom ElliottT
                                  Tom Elliott @christopherJames
                                  last edited by

                                  @christopherJames for command line to work I think you would need to double quote the password so it sends all the data. Currently it’s just sending the stuff between the quotes, not the quotes themselves.

                                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                  1 Reply Last reply Reply Quote 0
                                  • C
                                    christopherJames @george1421
                                    last edited by

                                    @george1421 said:

                                    @christopherJames I think the first / next thing you need to do is get control of your sql server. To do this you need to work through the process of resetting root’s password for mssql. Here is a guide to get you started. https://support.rackspace.com/how-to/mysql-resetting-a-lost-mysql-root-password/
                                    Please don’t use any special characters in the password especially '?%"/#`

                                    After you get the password reset ensure that you can login to mysql as root using mysql -u root then it will prompt you for the password. Now I’m going to suspect that nothing fog related is in the database. If you then issue the command show databases; you will see a list of databases in mysql. Either way just key in exit to leave the mysql console. Then move over to the .fogsettings file and update the database password with what you set the root password for mysql to. Then rerun the installer and hopefully it will recreate the missing mysql stuff.

                                    I did as instructed by what I found at that link and now I can access the MySQL database:

                                    christopher@NUC001:~$ mysql --user=root --password=6sharp.dripping
                                    Warning: Using a password on the command line interface can be insecure.
                                    Welcome to the MySQL monitor.  Commands end with ; or \g.
                                    Your MySQL connection id is 3
                                    Server version: 5.6.28-0ubuntu0.15.10.1 (Ubuntu)
                                    
                                    Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
                                    
                                    Oracle is a registered trademark of Oracle Corporation and/or its
                                    affiliates. Other names may be trademarks of their respective
                                    owners.
                                    
                                    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
                                    
                                    mysql> show databases;
                                    +--------------------+
                                    | Database           |
                                    +--------------------+
                                    | information_schema |
                                    | mysql              |
                                    | performance_schema |
                                    | test               |
                                    +--------------------+
                                    4 rows in set (0.03 sec)
                                    
                                    mysql> quit
                                    Bye
                                    christopher@NUC001:~$ 
                                    
                                    
                                    george1421G 1 Reply Last reply Reply Quote 0
                                    • C
                                      christopherJames
                                      last edited by

                                      @Wayne-Workman @Tom-Elliott @george1421

                                      Thank you guys for ALL your tireless help, you’re amazing.

                                      I will have to pick this up again tomorrow evening, no more time tonight.

                                      And thank you again.

                                      1 Reply Last reply Reply Quote 0
                                      • george1421G
                                        george1421 Moderator @christopherJames
                                        last edited by george1421

                                        @christopherJames Great! now you have access to mysql, and we can see fog did not create anything in the DB. Tomorrow, update the .fogsettings file with the password you just created and proved that it worked. Next run the installer again so it will recreate the fog install with the updated password. During the install you will be prompted to access the web management console to install/update the schema. If you can get past the update schema page, then complete the install and you should be set.

                                        (I might say you could “cheat” and just update the php config page directly with the password, then try to update the schema, but there is no guaranty that it will work this way.)

                                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                        C 1 Reply Last reply Reply Quote 0
                                        • C
                                          christopherJames @george1421
                                          last edited by christopherJames

                                          @george1421 said:

                                          @christopherJames Great! now you have access to mysql, and we can see fog did not create anything in the DB. Tomorrow, update the .fogsettings file with the password you just created and proved that it worked.

                                          I’m assuming by .fogsettings you mean /var/www/fog/lib/fog/Config.class.php

                                          Next run the installer again so it will recreate the fog install with the updated password. During the install you will be prompted to access the web management console to install/update the schema. If you can get past the update schema page, then complete the install and you should be set.

                                          I re-installed (is there even a way to uninstall first?) but still get:

                                          The website encountered an error while retrieving http://192.168.1.101/fog/management/. It may be down for maintenance or configured incorrectly.

                                          I checked the status of the apache server:

                                          christopher@NUC001:~$ systemctl status -l apache2.service
                                          ● apache2.service - LSB: Apache2 web server
                                             Loaded: loaded (/etc/init.d/apache2)
                                             Active: active (running) since Wed 2016-02-17 17:52:45 EST; 5min ago
                                               Docs: man:systemd-sysv-generator(8)
                                            Process: 10184 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
                                            Process: 5510 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
                                            Process: 10221 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
                                             CGroup: /system.slice/apache2.service
                                                     ├─10235 /usr/sbin/apache2 -k start
                                                     ├─10238 /usr/sbin/apache2 -k start
                                                     ├─10239 /usr/sbin/apache2 -k start
                                                     ├─10240 /usr/sbin/apache2 -k start
                                                     ├─10241 /usr/sbin/apache2 -k start
                                                     ├─10242 /usr/sbin/apache2 -k start
                                                     └─10843 /usr/sbin/apache2 -k start
                                          
                                          Feb 17 17:52:44 NUC001 systemd[1]: Starting LSB: Apache2 web server...
                                          Feb 17 17:52:44 NUC001 apache2[10221]: * Starting web server apache2
                                          Feb 17 17:52:44 NUC001 apache2[10221]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
                                          Feb 17 17:52:45 NUC001 apache2[10221]: *
                                          Feb 17 17:52:45 NUC001 systemd[1]: Started LSB: Apache2 web server.
                                          
                                          
                                          
                                          Wayne WorkmanW 1 Reply Last reply Reply Quote 0
                                          • Wayne WorkmanW
                                            Wayne Workman @christopherJames
                                            last edited by

                                            @christopherJames said:

                                            I’m assuming by .fogsettings you mean /var/www/fog/lib/fog/Config.class.php

                                            No. Anytime you see someone refer to .fogsettings they mean /opt/fog/.fogsettings

                                            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                                            Daily Clean Installation Results:
                                            https://fogtesting.fogproject.us/
                                            FOG Reporting:
                                            https://fog-external-reporting-results.fogproject.us/

                                            C 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 2 / 2
                                            • First post
                                              Last post

                                            120

                                            Online

                                            12.1k

                                            Users

                                            17.3k

                                            Topics

                                            155.3k

                                            Posts
                                            Copyright © 2012-2024 FOG Project