problems while attaching sql backend

Moderator: crythias

Locked
ktd85
Znuny newbie
Posts: 1
Joined: 22 Aug 2010, 15:21
Znuny Version: 2.4.7

problems while attaching sql backend

Post by ktd85 »

Hi,

I successfully insalled otrs 2.4.7.
Now I'm trying to configure a customer data backend using ms sql.
I'm able to lookup all my customers using the menu point customers.
But the customers arent able to login and i'm not able to choose a customer for a new ticket.
After the popup windows closed the page starts loading and ends up after 3 min and an internal server error.
The log is conatining the following lines:

Code: Select all

[Sun Aug 22 15:19:40 2010][Debug][Kernel::System::CustomerUser::DB::CustomerUserDataGet][449] DB.pm->Prepare (2/1282483180) SQL: 'SELECT  name1,  name2,  kdnr1,  solpasswort,  email,  kdnr1,  telefon,  telefax,  strasse,  plz,  ort,  land,  kdnr1, kdnr1 FROM kunde WHERE LOWER(kdnr1) = LOWER('14061')'
[Sun Aug 22 15:19:40 2010][Debug][Kernel::System::CustomerUser::Preferences::DB::GetPreferences][81] DB.pm->Prepare (3/1282483180) SQL: 'SELECT preferences_key, preferences_value  FROM customer_preferences WHERE user_id = ?'
[Sun Aug 22 15:19:40 2010][Debug][Kernel::System::CustomerUser::DB::CustomerUserDataGet][449] DB.pm->Prepare (3/1282483180) SQL: 'SELECT  name1,  name2,  kdnr1,  solpasswort,  email,  kdnr1,  telefon,  telefax,  strasse,  plz,  ort,  land,  kdnr1, kdnr1 FROM kunde WHERE LOWER(kdnr1) = LOWER('22064')'
[Sun Aug 22 15:19:40 2010][Debug][Kernel::System::CustomerUser::Preferences::DB::GetPreferences][81] DB.pm->Prepare (4/1282483180) SQL: 'SELECT preferences_key, preferences_value  FROM customer_preferences WHERE user_id = ?'
[Sun Aug 22 15:19:40 2010][Debug][Kernel::System::CustomerUser::DB::CustomerUserDataGet][449] DB.pm->Prepare (4/1282483180) SQL: 'SELECT  name1,  name2,  kdnr1,  solpasswort,  email,  kdnr1,  telefon,  telefax,  strasse,  plz,  ort,  land,  kdnr1, kdnr1 FROM kunde WHERE LOWER(kdnr1) = LOWER('28055')'
[Sun Aug 22 15:19:40 2010][Debug][Kernel::System::CustomerUser::Preferences::DB::GetPreferences][81] DB.pm->Prepare (5/1282483180) SQL: 'SELECT preferences_key, preferences_value  FROM customer_preferences WHERE user_id = ?'
I'm now worried about the question mark in there. When a user tries to login the preferences are tried to be loaded by questionmark as well :-(

Now thats my config. Maybe i missed some thing:

Code: Select all

    #Kundendatenbank-Anbindung Servatum
    $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::DB';
    $Self->{'Customer::AuthModule::DB::Type'} =  'mssql';
    $Self->{'Customer::AuthModule::DB::DSN'} = "DBI:ODBC:driver={SQL Server};Server=10.X.X.X,1433;database=servatum;uid=sa;pwd=password;";
    $Self->{'Customer::AuthModule::DB::Table'} = 'kunde';
    $Self->{'Customer::AuthModule::DB::CustomerKey'} = 'kdnr1';
    $Self->{'Customer::AuthModule::DB::CustomerPassword'} = 'solpasswort';
    $Self->{'Customer::AuthModule::DB::CryptType'} =  'plain';


    # CustomerUser
    # (customer user database backend and settings)
    $Self->{CustomerUser} = {
        Name => 'Servatum',
        Module => 'Kernel::System::CustomerUser::DB',
        Params => {
            # if you want to use an external database, add the
            # required settings
            DSN => 'DBI:ODBC:driver={SQL Server};Server=10.X.X.X,1433;database=servatum;uid=sa;pwd=password;',
	    Type =>  'mssql',
            Table => 'kunde',
	    SourceCharset => 'iso-8859-1',
	    DestCharset => 'utf-8',
        },
        # customer uniq id
        CustomerKey => 'kdnr1',
        # customer #
        CustomerID => 'kdnr1',
        CustomerUserListFields => ['name1', 'name2', 'telefon'],
        CustomerUserSearchFields => ['kdnr1', 'name1', 'name2', 'telefon','email'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserSearchListLimit =>50,
        CustomerUserPostMasterSearchFields => ['email'],
        CustomerUserNameFields => ['andrede','name1','name2'],
        CustomerUserEmailUniqCheck => 0,
#        # show not own tickets in customer panel, CompanyTickets
#        CustomerUserExcludePrimaryCustomerID => 0,
#        # generate auto logins
        AutoLoginCreation => 1,
#        AutoLoginCreationPrefix => 'auto',
#        # admin can change customer preferences
        AdminSetPreferences => 1,
#        # cache time to life in sec. - cache any database queris
        CacheTTL => 0,
#        # just a read only source
        ReadOnly => 1,
        Map => [

            # note: Login, Email and CustomerID needed!
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target
            [ 'UserFirstname',   'Firstname',   'name1',  1, 1, 'var', '', 0 ],
            [ 'UserLastname',   'Lastname',   'name2',  1, 1, 'var', '', 0 ],
            [ 'UserLogin',      'Username',   'kdnr1',      1, 1, 'var', '', 0 ],
            [ 'UserPassword',   'Password',   'solpasswort',         1, 0, 'var', '', 0 ],
            [ 'UserEmail',      'Email', 'email',           2, 0, 'var', '',0],
#            [ 'UserEmail',      'Email', 'email',           1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"ArticleID"}', 0 ],
            [ 'UserCustomerID', 'CustomerID', 'kdnr1', 1, 1, 'var', '', 0 ],
            [ 'UserPhone',        'Phone',       'telefon',        1, 0, 'var', '', 0 ],
            [ 'UserFax',          'Fax',         'telefax',          1, 0, 'var', '', 0 ],
            [ 'UserStreet',       'Street',      'strasse',       1, 0, 'var', '', 0 ],
            [ 'UserZip',          'Zip',         'plz',          1, 0, 'var', '', 0 ],
            [ 'UserCity',         'City',        'ort',         1, 0, 'var', '', 0 ],
            [ 'UserCountry',      'Country',     'land',      1, 0, 'var', '', 0 ],
            [ 'ValidID',          'Valid',       'kdnr1',     0, 1, 'int', '', 0 ],
        ],
        # default selections
        Selections => {
            UserSalutation => {
                '1' => 'Herr',
                '2' => 'Frau',
            },
        },
    };
I found one similar post in a mailing list which didn't had any reply.
Does anyone have a idea?

thanks so mutch
thomas
FlavioB
Znuny newbie
Posts: 18
Joined: 08 Nov 2010, 16:55
Znuny Version: 2.4.9

Re: problems while attaching sql backend

Post by FlavioB »

Hallo Thomas,

did you get further with your issue?

I'm in a similar situation, thus I'd like to go through it "step-by-step" with you, if you'd be that kind.
I can't test my ODBC connection with FreeTDS from Linux, can you help? Can you post your ODBC configuration?
Which MS DB do you use? I'm on MS SQL 2005 Express!

Thanks,
F.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: problems while attaching sql backend

Post by crythias »

Your users log in with a 5 digit number as username?

Edit: even with that, I'm not entirely certain where the fault lies. You appear to have the information there...
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
FlavioB
Znuny newbie
Posts: 18
Joined: 08 Nov 2010, 16:55
Znuny Version: 2.4.9

Re: problems while attaching sql backend

Post by FlavioB »

No, I'm not using MSSQL for logins.
I just need to read Customer Data.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: problems while attaching sql backend

Post by crythias »

FlavioB wrote:No, I'm not using MSSQL for logins.
I just need to read Customer Data.
I misread the date of the original post, and thought that you were posting on a contemporary post, so I responded as if talking to the original poster.

It's ok if you'd like to take this to a new topic...

various posts indicate sybase might be adequate for your purpose (grabbing data) http://forums.otrs.org/viewtopic.php?f= ... ase#p26265
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
FlavioB
Znuny newbie
Posts: 18
Joined: 08 Nov 2010, 16:55
Znuny Version: 2.4.9

Re: problems while attaching sql backend

Post by FlavioB »

Hy again.
I don't know if it would make sense to open a new topic, maybe going on in this one could help other people when "trying to attach sql backend"...

Nevertheless, I read the link you posted, I already stumbled over it some weeks ago. There it is stated that "ODBC is better" if you have LONG variables or such...
I'm still *not* able to connect using ODBC from my Linux Server:

root@ticket:~# isql -v sqlexpress sa
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[ISQL]ERROR: Could not SQLConnect

My ODBC config:

root@ticket:~# cat /etc/odbc.ini
[sqlexpress]
Driver = FreeTDS
#Driver = /usr/lib/odbc/libtdsodbc.so
Port = 1433
Description = MS SQL Server 2005 Express
Trace = Yes
Servername = exchange.piramide.local
Database = Piramide_Informatica
#TDS_Version = 8.0

Do you have some knowledge about this? How did *you* achieve your goal?

F.
Locked