Okay, I found the culprit.
I still had listed on the /opt/fog/.fogsettings
mysql-client mysql-server
on the packages list, instead of
mariadb-client mariadb-server
This came from a migration from another server.
Okay, I found the culprit.
I still had listed on the /opt/fog/.fogsettings
mysql-client mysql-server
on the packages list, instead of
mariadb-client mariadb-server
This came from a migration from another server.
Okay, I found the culprit.
I still had listed on the /opt/fog/.fogsettings
mysql-client mysql-server
on the packages list, instead of
mariadb-client mariadb-server
This came from a migration from another server.
On a ubuntu server, I fail to update FOG from 1.5.10.1798 to 1.5.10.1870 :
before the update:
$ dpkg -l | grep mysql-client
ii mysql-client 8.0.46-0ubuntu0.22.04.2 all MySQL database client (metapackage depending on the latest version)
ii mysql-client-8.0 8.0.46-0ubuntu0.22.04.2 amd64 MySQL database client binaries
ii mysql-client-core-8.0 8.0.46-0ubuntu0.22.04.2 amd64 MySQL database core client binaries
then:
$ sudo ./installfog.sh
[...]
* Checking package: liblzma-dev...............................OK
* Checking package: m4........................................OK
* Checking package: mariadb-server............................OK
* Checking package: mysql-client..............................Failed!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! The installer was not able to run all the way to the end as !!
!! something has caused it to fail. The following few lines are !!
!! from the error log file which might help us figure out what's !!
!! wrong. Please add this information when reporting an error. !!
!! As well you might want to take a look at the full error log !!
!! in /tmp/fogproject-1.5.10.1870/bin/error_logs/fog_error_1.5.10.1870.log !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ii libc6:amd64 2.35-0ubuntu3.13 amd64 GNU C Library: Shared libraries
ii liblzma-dev:amd64 5.2.5-2ubuntu1 amd64 XZ-format compression library - development files
ii m4 1.4.18-5ubuntu2 amd64 macro processing language
ii mariadb-server 1:10.6.23-0ubuntu0.22.04.1 all MariaDB database server (metapackage depending on the latest version)
dpkg-query: no packages found matching mysql-client
and if I check the packages:
$ dpkg -l | grep mysql-client
It’s not there anymore.
I wanted to determine the version installed after an update from 1.5.10.1754 to 1.5.10.1798 by checking the /opt/fog/.fogsettings file (greping “Version”) but the version remain on the previous version.
I’m not sure if this is intended, but I’m wondering if there is another way to check WITHOUT using the web interface / mysql database, the currently installed version (from only the CLI) ?
Here are the steps I used to update:
wget https://github.com/FOGProject/fogproject/archive/refs/tags/1.5.10.1798.tar.gz
tar xvfz 1.5.10.1798.tar.gz
cd fogproject-1.5.10.1798/bin/
sudo ./installfog.sh
@wayne-workman Hi, thanks for the tip.
In case we’re not in the position to migrate to a new server. What are you suggesting ?
A) Doing all the backup (for the migration), then uninstalling/removing FOG, then upgrade the OS to reinstall fog after then upgrade ?
or
B) Upgrade FOG to the latest version, then upgrade the OS ?
I can understand that a “proper” migration is always better, but that wouldn’t be far from removing all, then re-install properly, right ?
thanks @george1421
But then, for the next upgrade, shall I keep the .fogsettings like it is ? or use the fogstorage (and replace it on the file) ? 
I just upgrade a server from Ubuntu 18.04 (with fog 1.5.7) to Ubuntu 22.04 (with fog 1.5.9 dev-branch).
I used the dev-branch for the php8 compatibility (from this advise here: https://issueantenna.com/repo/fogproject/fogproject/issues/462#comment-IC_kwDOAR8IuM4_9o39 )
During the installation, it asks to create the mysql root password but it also generated a new snmysqluser|pass like this :
snmysqluser='fogstorage'
snmysqlpass='xxxxxxxxxxx'
and this is where things gets weird.
Before, on 1.5.7 I had :
snmysqluser='root'
snmysqlpass=''
snmysqlhost='localhost'
following the upgrade to 1.5.9 my .fogsettings file has been updated to :
snmysqluser='fogmaster' # instead of 'fogstorage'
snmysqlpass='YYYYYYYY' # not the same as the 'xxxx' printed out earlier
snmysqlhost='localhost'
Now the question is : Should I take the user/pass from the install script, or keep the one that has been added/edited on my fogsetting file ?
@Sebastian-Roth said in the API return 404 (or 501/302 when using /api/index.php?):
@Nono Sorry for the very long delay. Took me a while to find the time to look into this and figure it out. Seems like the default site apache config is somehow overwriting our 001-fog.conf and therefore the rewrite rules don’t kick in. Not sure if this is just on Ubuntu. Don’t have the time to try other distros as well but for now I assume this is specific for Ubuntu. Run this to fix the issue for now:
a2dissite 000-default.conf service apache2 restart
Thanks @Sebastian-Roth,
Expect the “apache2” instead of “apache”, it works much better !
I’m going to update the github case as well.
Hi @Tom-Elliott ,
I tried to disable / enable again : No luck
I tried to reset both token : No luck.
Any idea ?
I’m sorry for the double-posting, but after submitting my issue on github (https://github.com/FOGProject/fogproject/issues/263) I realized that it could have been a technical issue (even though, the installation of both, system + FOG is brand new).
Basically, the API doesn’t seems to works correctly, the log are on the github, for for better reading/following, here is a copy/paste of my issue :
Hi there,
I’m currently unable to use the API as I constantly got either a 404 or 501/302 (using for instance, this command) :
$ curl -H "fog-api-token: MjUwYjkxNGU4YTJkNjM3MDliNmVlZDFjZGE5YjcwNjg2N2Y1ZWE1NjMxMzFkZTk4Y2ZhOWZjNGJjZDUyZGIxNTljODg0NDhiM2RlODBmMzc5ZWFkMTkxxxxx1NDU5OTZhMzIwODJmYThiNWI0MzhhYjkwMDZhNzQ1MTFiNjg" -H "fog-user-token: NTQ5MWJiMjgxNmI5OTcyZDM5OTMzMWJlZjlkZWM4Y2M2MDg0ZTI5MTQ5MGZlYzdkNmYzY2NjNTc1OGE1ZGE3ODY4NDlkOWU4NjFiMzdmOTU5MDxxxN2NjNDQxYjhlMWI3MjYxZDMxZmRkZmNkY2M1Mjk4ZGNmZGUzMzNiNWY" -X GET http://192.168.6.128/fog/system/info
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /fog/system/info was not found on this server.</p>
<hr>
<address>Apache/2.4.34 (Ubuntu) Server at 192.168.6.128 Port 80</address>
</body></html>
from apache “acces.log” ;
"GET /fog/system/info HTTP/1.1" 404 453 "-" "curl/7.58.0"
Using /api/index.php?system/info gave me a 501 :
$ curl -H "fog-api-token: MjUwYjkxNGU4YTJkNjM3MDliNmVlZDFjZGE5YjcwNjg2N2Y1ZWE1NjMxMzFkZTk4Y2ZhOWZjNGJjZDUyZGIxNTljODg0NDhiM2RlODBmMzc5ZWFkMTkxxxxx1NDU5OTZhMzIwODJmYThiNWI0MzhhYjkwMDZhNzQ1MTFiNjg" -H "fog-user-token: NTQ5MWJiMjgxNmI5OTcyZDM5OTMzMWJlZjlkZWM4Y2M2MDg0ZTI5MTQ5MGZlYzdkNmYzY2NjNTc1OGE1ZGE3ODY4NDlkOWU4NjFiMzdmOTU5MDxxxN2NjNDQxYjhlMWI3MjYxZDMxZmRkZmNkY2M1Mjk4ZGNmZGUzMzNiNWY" -X GET http://192.168.6.128/fog/api/index.php?system/info
Related access.log entry:
"GET /fog/api/index.php?system/info HTTP/1.1" 501 678 "-" "curl/7.58.0"
FYI; here is my (untouched) /etc/apache2/sites-enabled/001-fog.conf:
<VirtualHost *:80>
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:9000/"
</FilesMatch>
KeepAlive Off
ServerName 192.168.2.1
DocumentRoot /var/www/
<Directory /var/www/fog/>
DirectoryIndex index.php index.html index.htm
</Directory>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
RewriteRule ^/fog/(.*)$ /fog/api/index.php [QSA,L]
</VirtualHost>