Bug 1812116 - Xmoto does not start.
Summary: Xmoto does not start.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: xmoto
Version: 32
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-10 14:43 UTC by Lukas Ruzicka
Modified: 2020-03-24 17:50 UTC (History)
2 users (show)

Fixed In Version: xmoto-0.5.11-20.fc32
Clone Of:
Environment:
Last Closed: 2020-03-24 17:50:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lukas Ruzicka 2020-03-10 14:43:13 UTC
Description of problem:

Xmoto does not start because of "fatal exception : Unable to get xmDb version:"

Version-Release number of selected component (if applicable):
xmoto-0.5.11-19.fc32.x86_64

How reproducible:

Always

Steps to Reproduce:
1. sudo dnf install xmoto
2. xmoto

Actual results:
See above

Expected results:
Xmoto should work or be removed.

Comment 1 Gwyn Ciesla 2020-03-10 14:50:55 UTC
It works for me on f31. Do you have proper permissions on ~/.local/share/xmoto/xm.db?

Comment 2 Paul Dufresne 2020-03-15 23:21:47 UTC
Same result here on Fedora-Games-Live-x86_64-32_Beta-1.2.iso (in live mode).

Although dnf info xmoto gives:
[liveuser@localhost-live ~]$ dnf info xmoto
Last metadata expiration check: 0:08:01 ago on Sun 15 Mar 2020 07:11:46 PM EDT.
Installed Packages
Name         : xmoto
Version      : 0.5.11
Release      : 19.fc32
Architecture : x86_64

xmoto -v gives:
[liveuser@localhost-live ~]$ xmoto -v
X-Moto 0.5.12
compiled at Jan 31 2020 00:00:00
Systeme is littleendien
User data   directory: /home/liveuser/.local/share/xmoto
User config directory: /home/liveuser/.config/xmoto
User cache  directory: /home/liveuser/.cache/xmoto
System data directory: /usr/share/xmoto
UserUnload started at 3766449.500
net: number of TCP packets sent      : 0
net: biggest TCP packet sent         : 0 bytes
net: size of TCP packets sent        : 0 bytes
net: number of UDP packets sent      : 0
net: biggest UDP packet sent         : 0 bytes
net: size of UDP packets sent        : 0 bytes
net: number of TCP packets received  : 0
net: biggest TCP packet received     : 0 bytes
net: size of TCP packets received    : 0 bytes
net: number of UDP packets received  : 0
net: biggest UDP packet received     : 0 bytes
net: size of UDP packets received    : 0 bytes
UserUnload ended at 3766449.500
fatal exception : Unable to get xmDb version: 
[liveuser@localhost-live ~]$

Comment 3 Paul Dufresne 2020-03-15 23:56:57 UTC
from https://searchcode.com/codesearch/view/22441642/
showing /xmoto-0.5.10/src/db/xmDatabase.cpp 
I see the code probably showing the problem is (line 330):
int xmDatabase::getXmDbVersion() {
  char **v_result;
  int nrow;
  int ncolumn;
  char *errMsg;
  std::string v_errMsg;
  int v_version;

  /* check if table xm_parameters exists */
  if(doesTableExists("xm_parameters") == false) {
    return 0;
  }

  /* dabatase created, get the version number */
  if(sqlite3_get_table(m_db,
		       "SELECT value FROM xm_parameters WHERE param=\"xmdb_version\";",
		       &v_result, &nrow, &ncolumn, &errMsg)
     != SQLITE_OK) {
    v_errMsg = errMsg;
    sqlite3_free(errMsg);
    throw Exception("Unable to get xmDb version: " + v_errMsg);
  }

  if(nrow != 1) {
    sqlite3_free_table(v_result);
    throw Exception("Unable to get xmDb version: " + v_errMsg);
  }
  v_version = atoi(v_result[1]);
  sqlite3_free_table(v_result);

  return v_version;
}

I did:
[liveuser@localhost-live ~]$ ls -lh ~/.local/share/xmoto/
total 28K
drwx------. 2 liveuser liveuser 4.0K Mar 15 18:49 Levels
drwx------. 2 liveuser liveuser 4.0K Mar 15 18:49 Replays
-rw-r--r--. 1 liveuser liveuser  20K Mar 15 18:49 xm.db

[liveuser@localhost-live ~]$ sqlite3 ~/.local/share/xmoto/xm.db
...
sqlite> .dump xm_parameters
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE xm_parameters(param PRIMARY KEY, value);
INSERT INTO xm_parameters VALUES('siteKey','202003151849185733255');
COMMIT;
sqlite> 

which suggest the only "value" in xm_parameters is sitekey... the expected xmdb_version seems missing...
At the begining of xmDatabase.cp we have:
#define XMDB_VERSION         36
which is probably the expected value.

well... I am far from an expert on this... guess I should compare with Fedora 31.

Comment 4 Paul Dufresne 2020-03-16 00:34:40 UTC
hum... if I rename or remove ~/.local/share/xmoto/xm.db then I get:
fatal exception : FontManager: Couldn't open Textures/Fonts/DejaVuSans.ttf

after that, the following executions give the previous errors...

in cat  ~/.cache/xmoto/xmoto.log I get:
** Warning ** : font prerequisites missing, switching to en_US: File Textures/Fonts/DejaVuSans.ttf is missing

[liveuser@localhost-live share]$ ls -lh /usr/share/xmoto/Textures/Fonts/
total 316K
-rw-r--r--. 1 root root 315K Jan 29  2011 DejaVuSansMono.ttf
lrwxrwxrwx. 1 root root   36 Jan 31 03:21 DejaVuSans.ttf -> ../../../fonts/dejavu/DejaVuSans.ttf
[liveuser@localhost-live share]$ ls -lh /usr/share/xmoto/Textures/Fonts/../../../
Display all 340 possibilities? (y or n)
[liveuser@localhost-live share]$ ls -lh /usr/share/xmoto/Textures/Fonts/../../../f
factory/      fedora-logos/ fillets-ng/   firstboot/    fonts/        foomatic/     freecol/      
farstream/    file/         firewalld/    fontconfig/   foobillard/   freeciv/      freedroidrpg/ 
[liveuser@localhost-live share]$ ls -lh /usr/share/xmoto/Textures/Fonts/../../../fonts/
aajohan-comfortaa/          gnu-free/                   liberation-serif/           paratype-pt-sans/
adobe-source-code-pro/      google-droid-sans-fonts/    lohit-assamese/             sil-abyssinica/
bitstream-vera-sans-fonts/  google-noto/                lohit-bengali/              sil-mingzat/
bitstream-vera-serif-fonts/ google-noto-cjk/            lohit-devanagari/           sil-nuosu/
cantarell/                  google-noto-emoji/          lohit-gujarati/             sil-padauk/
dejavu-sans-fonts/          google-noto-vf/             lohit-kannada/              smc-meera/
dejavu-sans-mono-fonts/     jomolhari/                  lohit-odia/                 stix-fonts/
dejavu-serif-fonts/         julietaula-montserrat/      lohit-tamil/                thai-scalable/
extremetuxracer/            khmeros/                    lohit-telugu/               urw-base35/
freecol/                    liberation-mono/            nethack-bitmap/             wqy-zenhei/
gdouros-symbola/            liberation-sans/            paktype-naskh-basic/        
[liveuser@localhost-live share]$ ls -lh /usr/share/xmoto/Textures/Fonts/../../../fonts/dejavu-sans-fonts/
total 5.6M
-rw-r--r--. 1 root root 629K Jul 30  2016 DejaVuSans-BoldOblique.ttf
-rw-r--r--. 1 root root 690K Jul 30  2016 DejaVuSans-Bold.ttf
-rw-r--r--. 1 root root 627K Jul 30  2016 DejaVuSansCondensed-BoldOblique.ttf
-rw-r--r--. 1 root root 688K Jul 30  2016 DejaVuSansCondensed-Bold.ttf
-rw-r--r--. 1 root root 619K Jul 30  2016 DejaVuSansCondensed-Oblique.ttf
-rw-r--r--. 1 root root 738K Jul 30  2016 DejaVuSansCondensed.ttf
-rw-r--r--. 1 root root 349K Jul 30  2016 DejaVuSans-ExtraLight.ttf
-rw-r--r--. 1 root root 621K Jul 30  2016 DejaVuSans-Oblique.ttf
-rw-r--r--. 1 root root 740K Jul 30  2016 DejaVuSans.ttf
[liveuser@localhost-live share]$ 

So the bug seems that the directory dejavu have been renamed to dejavu-sans-fonts  ?

Comment 5 Paul Dufresne 2020-03-16 00:45:01 UTC
So as a workaround I tried to:
cd /usr/share/xmoto/Textures/Font
sudo mv DejaVuSans.ttf DejaVuSans.ttf.old
sudo cp ../../../fonts/dejavu-sans-fonts/DejaVuSans.ttf .
[liveuser@localhost-live Fonts]$ ls -lh
total 1.1M
-rw-r--r--. 1 root root 315K Jan 29  2011 DejaVuSansMono.ttf
-rw-r--r--. 1 root root 740K Mar 15 20:41 DejaVuSans.ttf
lrwxrwxrwx. 1 root root   36 Jan 31 03:21 DejaVuSans.ttf.old -> ../../../fonts/dejavu/DejaVuSans.ttf
[liveuser@localhost-live Fonts]$ 

mv  ~/.local/share/xmoto/xm.db ~/.local/share/xmoto/xm.db.old

xmoto -v

and now it launch fine!

Comment 6 Gwyn Ciesla 2020-03-16 15:24:12 UTC
Gotcha, I'll get a fixed xmoto build out ASAP. Thank you!

Comment 7 Fedora Update System 2020-03-16 15:32:43 UTC
FEDORA-2020-fa82e291f4 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-fa82e291f4

Comment 8 Paul Dufresne 2020-03-16 21:11:44 UTC
The new xmoto-0.5.11-20.fc32 on https://koji.fedoraproject.org/koji/buildinfo?buildID=1478069 fix it for people that did not try to run xmoto on release 19.fc32 (works for me). But if you have run xmoto version 19.fc32, then you continue to get the:
[liveuser@localhost-live ~]$ xmoto
fatal exception : Unable to get xmDb version: 
[liveuser@localhost-live ~]$ 
until you erased or rename the ~/.local/share/xmoto/xm.db file.

Kind of underlying bug seems that xmoto seems to get some initial configuration the first time it is run in the xm.db file.
Guess it should erase that file if an error like not being able to load a font happens. Which is a kind of an other less important bug... that
I guess I should open a new bug report for? [even fixing this bug, would not have erased the file for people that have try to run release 19]

Comment 9 Gwyn Ciesla 2020-03-16 21:33:52 UTC
if you just put the old file back, does that work?

Comment 10 Fedora Update System 2020-03-17 02:48:53 UTC
xmoto-0.5.11-20.fc32 has been pushed to the Fedora 32 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-fa82e291f4

Comment 11 Fedora Update System 2020-03-24 17:50:02 UTC
FEDORA-2020-fa82e291f4 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.