client can't connect

Submitted by LudoA on 2006-12-30

EDIT: never mind, figured it out. /usr/share/webissues had bad permissions.

This is basically a copy of what I posted on kde-apps - should've come here first.

I'm using webissues-client-0.8.2.tar.bz2 and webissues-server-0.8.1.tar.bz2, on Debian sid (unstable). I configured correctly I think, at least setup.php worked fine.
Here's my

* Configuration file for the WebIssues Server.

* Database configuration.
* Create the database and set correct values before running
* the setup.php script.

$config[ 'db_engine' ]      = 'mysql'; // can be 'mysql' or 'pgsql'

$config[ 'db_host' ]        = 'localhost:825'; // can be 'host', 'host:port' or '/path/to/socket'
$config[ 'db_database' ]    = 'webissues'; // name of the database
$config[ 'db_user' ]        = 'www-data'; // database user login (if needed)
$config[ 'db_password' ]    = 'some_pwd'; // database user password (if needed)

$config[ 'db_prefix' ]      = 'wi'; // prefix of table names

* Logging configuration.
* Enter a file name (absolute or relative to index.php) to enable a log.

$config[ 'log_errors' ]     = 'logs/wi_error.log';
$config[ 'log_commands' ]   = 'logs/wi_commands.log';
$config[ 'log_sql' ]        = 'logs/wi_sql.log';

Running http://localhost:8080/webissues/setup.php worked fine. The admin password is the same as the db user's password.

When I try to connect using the client, it doesn't work though: "connection to server failed" appears in the statusbar.
The URL I used is "http://localhost:8080/webissues", login 'admin', password what I entered in setup.php.
If I use http://localhost:8080 as the URL, it tells me "a server error occured (302 found)" so it does detect it correctly.
I don't have anything in the logs, just in the sql logs (which contains the inserts from setup.php, and nothing else).
The setup* stuff was removed, but it didn't help.

Since adding all the data to the mysql db worked, I'm guessing there's nothing wrong with my setup. It also detects webissues (or I'd get another 302 I guess), so it has to be a problem with the logging in.

Anyone an idea how I can fix this?

(An unrelated remark: by default, there's nothing in the tray, and you can't open the connection using the file menu. So you have to change the configuration, tell it to display in the tray, rightclick on the tray icon, and open connection. Not a very good default IMHO. It'd be better if open connection was added to the file menu.)

It's my fault - it works if I change the url to http://localhost:8080/webissues/ (i.e. a trailing '/').

BTW when I start the client I get this:
$ webissues
webissues: WARNING: KXMLGUIClient::setXMLFile: cannot find .rc file mainwindowui.rc

So maybe I'm not supposed to have a blank window when the client starts up, and my comment about opening a connection was incorrect :)
After I log in, the window changes, I get a 'name' column header at the top, but the rest of the window stays blank. Shouldn't the example issues appear?
Also when I rightclick after logging in it crashes, saying this:

Using host libthread_db library "/lib/tls/".
[Thread debugging using libthread_db enabled]
[New Thread -1506904384 (LWP 3660)]
[KCrash handler]
#5 0xa6c3eac7 in QPopupMenu::exec (this=0x0, pos=@0xaf91ebac, indexAtPoint=0)
at widgets/qpopupmenu.cpp:2440
#6 0x08078e50 in WebIssues::ProjectsView::contextMenu ()
#7 0x080793fd in WebIssues::ProjectsView::qt_invoke ()
#8 0xa6b18cb3 in QObject::activate_signal (this=0x82266c0, clist=0x822a400,
o=0xaf91e89c) at kernel/qobject.cpp:2356
#9 0xa74acb3e in KListView::contextMenu (this=0xaf91e7f4, t0=0x82266c0,
t1=0x0, t2=@0xaf91ebac) at ./klistview.moc:519
#10 0xa74acbaf in KListView::emitContextMenu (this=0x82266c0, i=0x0,
at /home/ana/Debian/kdelibs/kdelibs-3.5.5a.dfsg.1/./kdeui/klistview.cpp:1907
#11 0xa75b3d2e in KListView::qt_invoke (this=0x82266c0, _id=99, _o=0xaf91e9e0)
at ./klistview.moc:571
#12 0x08084855 in ModelView::ListView::qt_invoke ()
#13 0xa6b18cb3 in QObject::activate_signal (this=0x82266c0, clist=0x822a250,
o=0xaf91e9e0) at kernel/qobject.cpp:2356
#14 0xa6eb9235 in QListView::rightButtonPressed (this=0x82266c0, t0=0x0,
t1=@0xaf91ebac, t2=-1) at .moc/debug-shared-mt/moc_qlistview.cpp:468
#15 0xa6c15efb in QListView::contentsMousePressEventEx (this=0x82266c0,
e=0xaf91ec9c) at widgets/qlistview.cpp:4421
#16 0xa6c15f28 in QListView::contentsMousePressEvent (this=0x82266c0,
e=0xaf91ec9c) at widgets/qlistview.cpp:4236
#17 0xa7478f1f in KListView::contentsMousePressEvent (this=0x82266c0,
at /home/ana/Debian/kdelibs/kdelibs-3.5.5a.dfsg.1/./kdeui/klistview.cpp:805
#18 0xa6c4ce91 in QScrollView::viewportMousePressEvent (this=0x82266c0,
e=0xaf91f214) at widgets/qscrollview.cpp:1733
#19 0xa6c4e2fc in QScrollView::eventFilter (this=0x82266c0, obj=0x8226ad0,
e=0xaf91f214) at widgets/qscrollview.cpp:1496
#20 0xa6c16396 in QListView::eventFilter (this=0x82266c0, o=0x8226ad0,
e=0xaf91f214) at widgets/qlistview.cpp:3866
#21 0xa6b18266 in QObject::activate_filters (this=0x8226ad0, e=0xaf91f214)
at kernel/qobject.cpp:903
#22 0xa6b182e4 in QObject::event (this=0x8226ad0, e=0xaf91f214)
at kernel/qobject.cpp:735
#23 0xa6b4f576 in QWidget::event (this=0x8226ad0, e=0xaf91f214)
at kernel/qwidget.cpp:4678
#24 0xa6ab0bd6 in QApplication::internalNotify (this=0xaf91f7d8,
receiver=0x8226ad0, e=0xaf91f214) at kernel/qapplication.cpp:2635
#25 0xa6ab2d79 in QApplication::notify (this=0xaf91f7d8, receiver=0x8226ad0,
e=0xaf91f214) at kernel/qapplication.cpp:2421
#26 0xa7261e0e in KApplication::notify (this=0xaf91f7d8, receiver=0x8226ad0,
at /home/ana/Debian/kdelibs/kdelibs-3.5.5a.dfsg.1/./kdecore/kapplication.cpp:550
#27 0xa6a44445 in QApplication::sendSpontaneousEvent (receiver=0x8226ad0,
event=0xaf91f214) at kernel/qapplication.h:523
#28 0xa6a430df in QETWidget::translateMouseEvent (this=0x8226ad0,
event=0xaf91f648) at kernel/qapplication_x11.cpp:4301
#29 0xa6a41660 in QApplication::x11ProcessEvent (this=0xaf91f7d8,
event=0xaf91f648) at kernel/qapplication_x11.cpp:3478
#30 0xa6a57cb2 in QEventLoop::processEvents (this=0x8110ce8, flags=4)
at kernel/qeventloop_x11.cpp:192
#31 0xa6acb129 in QEventLoop::enterLoop (this=0x8110ce8)
at kernel/qeventloop.cpp:198
#32 0xa6acaf4a in QEventLoop::exec (this=0x8110ce8)
at kernel/qeventloop.cpp:145
#33 0xa6ab276f in QApplication::exec (this=0xaf91f7d8)
at kernel/qapplication.cpp:2758
#34 0x08063daf in main ()

I don't think I compiled the client with debugging enabled, so I'll try to do that first. And see if I can find the missing mainwindowui.rc file.

From strace'ing it:

stat64("/home/ludo/.kde/share/apps/mainwindowui.rc", 0xaf9609d8) = -1 ENOENT (No such file or directory)
5024 stat64("/usr/share/apps/mainwindowui.rc", 0xaf9609d8) = -1 ENOENT (No such file or directory)
5025 stat64("/home/ludo/.kde/share/apps/webissues/mainwindowui.rc", 0xaf9608a8) = -1 ENOENT (No such file or directory)
5026 stat64("/usr/share/apps/webissues/mainwindowui.rc", 0xaf9608a8) = -1 EACCES (Permission denied)

So it exists in /usr/share/apps/webissues/mainwindowui.rc, but it's read-only for everyone but root:
-rw-r--r-- 1 root root 909 2006-11-05 18:49 /usr/share/apps/webissues/mainwindowui.rc

If it wants to write to it, IMHO it should copy that version to /home/ludo/.kde/share/apps/mainwindowui.rc and edit it there... no?

Just tried to copy it myself, and got a permission denied, the problem isn't the file, it's the dir:
dax ~ # ls -l /usr/share/apps/|grep webis
drwx------ 3 root root 4,0K 2006-12-30 16:20 webissues/

Edit: fixed the chmod, crash is gone now. Opening a connection doens't require the tray apparently :)
Is the chmod because of my system, or is it a mistake in the makefile? I'm pretty sure I didn't chmod it myself. If the makefile doesn't do it, I guess you can ignore this bugreport.

The URL works for me even without the trailing slash, because my web server automatically sends a 301 redirect. But that probably depends on the server and its settings. Perhaps the client should be smart enough to automatically add a slash when it's needed.

The makefiles are generated by the standard KDE autoconf/automake based build system, so I have no idea why the permissions are set incorrectly... I will add some NULL-pointer checking to prevent crashes, but the application is completely unusable without the *.rc files anyway :).

The main window is empty after logging in, because no projects and folders exist yet. The setup script only creates some example issue types, not example issues. Now that the menus are working, you should be able to create a project, a folder and some issues in it.

Thanks for testing the application. Keep informing me if you encounter any other problems.