owncloud-archive / chat

GNU Affero General Public License v3.0
38 stars 21 forks source link

Chat app doesn't work with `user_ldap` #128

Open frykillr opened 10 years ago

frykillr commented 10 years ago

Hi, i get this error in Explorer 11 and FireFox : An exception occurred while executing 'INSERT INTO oc_chat_och_users_online(session_id,last_online) VALUES(?,?)' with params ["48cd5aaa1ed881a4ee052e4593239919", 1409147193]: SQLSTATE[HY000]: General error: 1364 Field 'user' doesn't have a default value.

is it normal?

frykillr commented 10 years ago

and to specify, this error only occurs with the users from my LDAP...because the local users all have access to the CHAT and they can all see the users that are local AND LDAP...

so i don't know if theirs a config that i need to add to accept LDAP Users

LEDfan commented 10 years ago

It looks like when you try to login as LDAP user, oC can't find it's own contact. I think I know why this happen. I never installed LDAP before, but I'll try to solve this problem.

frykillr commented 10 years ago

@LEDfan did you had some time to find or think what could cause this problem?

LEDfan commented 10 years ago

@frykillr not yet. I first have to setup LDAP.

frykillr commented 10 years ago

@LEDfan hi, still no news ?

LEDfan commented 10 years ago

@frykillr just to be sure are you using the LDAP backend for ownCloud users or for the Contacts app?

frykillr commented 10 years ago

@LEDfan the LDAP Backend is for both application. contacts is active..but for now no users are using it. the owncloud is still in test mode before releasing it to everyone in the company. so there are not a lot of users in ldap that are using it, except me and the testers.

frykillr commented 10 years ago

@LEDfan hi still no use about the LDAP backend?

LEDfan commented 10 years ago

@frykillr you could help me with some information. Since you are on a test server can you do the following: (please don't output any real names) Just paste this code to the very end of /apps/chat/app.php and post the output here file and then remove it again.

echo "<pre>";
var_export(\OCP\User::getUsers());
var_export($chat->getContacts());
die();

Thx

frykillr commented 10 years ago

@LEDfan hi, i tried that with the file in chat\appinfo\app.php(that is where my app.php is in version) and when i add these line i get an error 500 in IE11 and a white screen in FireFox.

thx

frykillr commented 10 years ago

@LEDfan still no news about this problem ?

frykillr commented 10 years ago

@LEDfan anothet thing is weird... the local users are not able to use the chat anymore.. when the 'contacts' app is enable i get the error : 404 : contacts not found, and if i remove the contacts app i get error '12' on local users and LDAP users still has the same problem on any of these behaviors.

LEDfan commented 10 years ago

The contacts app error is caused by a bug in the Contacts app. Please try the current master or stable7 branch of the Contacts app. I found an online free LDAP server, so I'll try to solve the issue.

frykillr commented 10 years ago

@LEDfan ok done that, now my local admin gets the error '12', and all my LDAP users get the original error at the top of t his Issue Case.

frykillr commented 10 years ago

@LEDfan hi there, did you have time to check it with you're free LDAP server?

frykillr commented 10 years ago

@LEDfan hi, i'm getting this error now with my admin account(Local account) An exception occurred while executing ' SELECT * FROM oc_chat_attachments WHERE conv_id = ?' with params ["CONV_ID_1409147074_70"]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ownclouddb.oc_chat_attachments' doesn't exist

is it normal ? and other local users get error '12'.

LEDfan commented 9 years ago

Hi. I finally managed to create a working LDAP server. (Thanks to https://github.com/owncloud/core/wiki/How-to-test-user_ldap) The issue should be fixed with this: https://github.com/owncloud/core/pull/12784

Can you test this @frykillr?

juronius commented 9 years ago

Hello https://github.com/LEDfan/core/commit/e9e30b855738d6aee4fa42718cfedd2be474a316 I work for me ! On ownCloud v7.0.4 and LDAP authentification Active Directory on Windows server 2008R2. Very thank you.

Sorry for my english.

LEDfan commented 9 years ago

Hi @juronius. You are using the LDAP backend for owncloud users, right? Thanks for reporting!

juronius commented 9 years ago

Hello, Yes, i activated LDAP Backend.

LEDfan commented 9 years ago

Fixed in core, needs to be merged in 8.0.1.

LEDfan commented 9 years ago

@apg1980 @lunarok and others with LDAP problems please post a note in the PR at core, that you need this fix: https://github.com/owncloud/core/pull/13819 see next comment.

LEDfan commented 9 years ago

I managed to fix the Chat app instead of the core. It should work now with user_ldap. Try this build.zip

apg1980 commented 9 years ago

after enabling your build.zip the owncloud stucks in a white screen, i have to disable the chat app in phpmyadmin.

LEDfan commented 9 years ago

@apg1980 I'm sorry, there was a dependency problem on the build server. I fixed it now. build.zip Try again please.

apg1980 commented 9 years ago

After enabling the new build.zip (thank u by the way), i've got the old error after opening the app: Interner Serverfehler

DFatal index Exception: {"Message":"An exception occurred while executing '\t\t\tSELECT\n\t\t\t\tuser\n\t\t\tFROM\n\t\t\t\toc_chat_och_users_online':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'bitnami_owncloud.oc_chat_och_users_online' doesn't exist","Code":0,"Trace":"#0 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(116): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))\n#1 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php(172): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), '\t\t\tSELECT\n\t\t\t\t...', Array)\n#2 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/lib\/private\/db\/statementwrapper.php(65): Doctrine\\DBAL\\Statement->execute()\n#3 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/lib\/public\/appframework\/db\/mapper.php(213): OC_DB_StatementWrapper->execute()\n#4 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/apps\/chat\/lib\/och\/db\/useronlinemapper.php(26): OCP\\AppFramework\\Db\\Mapper->execute('\\t\\t\\tSELECT\\n\\t\\t\\t\\t...')\n#5 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/apps\/chat\/app\/chat.php(371): OCA\Chat\OCH\Db\UserOnlineMapper->getOnlineUsers()\n#6 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/apps\/chat\/app\/chat.php(520): OCA\Chat\App\Chat->getContacts()\n#7 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/apps\/chat\/app\/chat.php(511): OCA\Chat\App\Chat->getUserasContact('08598A5C-6FB6-4...')\n#8 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/apps\/chat\/controller\/appcontroller.php(65): OCA\Chat\App\Chat->getCurrentUser()\n#9 [internal function]: OCA\Chat\Controller\AppController->index()\n#10 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/lib\/private\/appframework\/http\/dispatcher.php(158): call_user_func_array(Array, Array)\n#11 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/lib\/private\/appframework\/http\/dispatcher.php(86): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Chat\Controller\AppController), 'index')\n#12 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/lib\/private\/appframework\/app.php(97): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Chat\Controller\AppController), 'index')\n#13 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/lib\/private\/appframework\/routing\/routeactionhandler.php(44): OC\AppFramework\App::main('AppController', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#14 [internal function]: OC\AppFramework\routing\RouteActionHandler->__invoke(Array)\n#15 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/lib\/private\/route\/router.php(250): call_user_func(Object(OC\AppFramework\routing\RouteActionHandler), Array)\n#16 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/lib\/base.php(763): OC\Route\Router->match('\/apps\/chat\/')\n#17 \/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/index.php(36): OC::handleRequest()\n#18 {main}","File":"\/OWNCLOUD-DATA\/opt\/bitnami\/apps\/owncloud\/htdocs\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php","Line":53}

LEDfan commented 9 years ago

Did you removed some tables from the Chat app maybe? Try to disable the Chat app via owncloud. Next execute the following queries: https://github.com/owncloud/chat/wiki/FAQ#uninstall-chat-app .(via e.g. PHPMyAdmin) next enable the Chat app again. Thanks for your patient !

apg1980 commented 9 years ago

after removing all entrys from der db table it works, but only after disabling the xmpp option in admin panel.