Solved (partly): Import doesn't stop

Moderator: crythias

Post Reply
RBehr
Znuny expert
Posts: 167
Joined: 26 Jan 2011, 13:23
Znuny Version: 3.0.7
Real Name: Rod Behr
Company: Impact
Location: London, United Kingdom
Contact:

Solved (partly): Import doesn't stop

Post by RBehr »

An import of CIs from a text file does not stop at the end of the text file. Instead, the import continues to a ridiculously high number (93744 attempts from a text file only 10413 lines long). The system log indicates an error for every line ("Identifier field is empty").

Why is this? This is a Windows-generated file - is there an EOF character which should be added?
Last edited by RBehr on 14 Dec 2011, 18:07, edited 1 time in total.
Rod Behr
Software Design Manager and Database Analyst | Impact Audiovisual | London
Installation: OTRS 3.0.7, Apache 2, Strawberry Perl 5 on Ubuntu 10.04.3 Server with separate MySQL Server, also on Ubuntu 10.04.3
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Import doesn't stop

Post by Wolfgangf »

did you define a key value in your import and is this field filled with data in your input file?
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
RBehr
Znuny expert
Posts: 167
Joined: 26 Jan 2011, 13:23
Znuny Version: 3.0.7
Real Name: Rod Behr
Company: Impact
Location: London, United Kingdom
Contact:

Re: Import doesn't stop

Post by RBehr »

Yes and yes. The data comes from an external system which uses a GUID as an identifier. This field is always populated and is defined as the identifier in the import map.
Rod Behr
Software Design Manager and Database Analyst | Impact Audiovisual | London
Installation: OTRS 3.0.7, Apache 2, Strawberry Perl 5 on Ubuntu 10.04.3 Server with separate MySQL Server, also on Ubuntu 10.04.3
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Import doesn't stop

Post by Wolfgangf »

ok - did you already try to debug im import script while importing this file with the perl-debugger?
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
RBehr
Znuny expert
Posts: 167
Joined: 26 Jan 2011, 13:23
Znuny Version: 3.0.7
Real Name: Rod Behr
Company: Impact
Location: London, United Kingdom
Contact:

Re: Import doesn't stop

Post by RBehr »

No. Any chance you could give me a little walkthrough on that? For my sins, I'm all ASP and not much Perl.
Rod Behr
Software Design Manager and Database Analyst | Impact Audiovisual | London
Installation: OTRS 3.0.7, Apache 2, Strawberry Perl 5 on Ubuntu 10.04.3 Server with separate MySQL Server, also on Ubuntu 10.04.3
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Import doesn't stop

Post by Wolfgangf »

no problem

Code: Select all

perl -d /opt/otrs/bin/ImportExport.pl -n <import-job-number> -a import -o <your-import-file.
and then step trough the source until you findout the reason for hanging

Code: Select all

nter h or `h h' for help, or `man perldebug' for more help.

main::(ImportExport.pl:41):     $VERSION = qw($Revision: 1.14 $) [1];
                                                                                                                                                                      DB<1> h
List/search source lines:               Control script execution:
  l [ln|sub]  List source code            T           Stack trace
  - or .      List previous/current line  s [expr]    Single step [in expr]
  v [line]    View around line            n [expr]    Next, steps over subs
  f filename  View source in file         <CR/Enter>  Repeat last n or s
  /pattern/ ?patt?   Search forw/backw    r           Return from subroutine
  M           Show module versions        c [ln|sub]  Continue until position
Debugger controls:                        L           List break/watch/actions
  o [...]     Set debugger options        t [expr]    Toggle trace [trace expr]
  <[<]|{[{]|>[>] [cmd] Do pre/post-prompt b [ln|event|sub] [cnd] Set breakpoint
  ! [N|pat]   Redo a previous command     B ln|*      Delete a/all breakpoints
  H [-num]    Display last num commands   a [ln] cmd  Do cmd before line
  = [a val]   Define/list an alias        A ln|*      Delete a/all actions
  h [db_cmd]  Get help on command         w expr      Add a watch expression
  h h         Complete help page          W expr|*    Delete a/all watch exprs
  |[|]db_cmd  Send output to pager        ![!] syscmd Run cmd in a subprocess
  q or ^D     Quit                        R           Attempt a restart
Data Examination:     expr     Execute perl code, also see: s,n,t expr
  x|m expr       Evals expr in list context, dumps the result or lists methods.
  p expr         Print expression (uses script's current package).
  S [[!]pat]     List subroutine names [not] matching pattern
  V [Pk [Vars]]  List Variables in Package.  Vars can be ~pattern or !pattern.
  X [Vars]       Same as "V current_package [Vars]".  i class inheritance tree.
  y [n [Vars]]   List lexicals in higher scope <n>.  Vars same as V.
  e     Display thread id     E Display all thread ids.
For more help, type h cmd_letter, or run man perldebug for all docs.
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
RBehr
Znuny expert
Posts: 167
Joined: 26 Jan 2011, 13:23
Znuny Version: 3.0.7
Real Name: Rod Behr
Company: Impact
Location: London, United Kingdom
Contact:

Re: Import doesn't stop

Post by RBehr »

You are the man! Thanks. I will work through this and report back.
Rod Behr
Software Design Manager and Database Analyst | Impact Audiovisual | London
Installation: OTRS 3.0.7, Apache 2, Strawberry Perl 5 on Ubuntu 10.04.3 Server with separate MySQL Server, also on Ubuntu 10.04.3
RBehr
Znuny expert
Posts: 167
Joined: 26 Jan 2011, 13:23
Znuny Version: 3.0.7
Real Name: Rod Behr
Company: Impact
Location: London, United Kingdom
Contact:

Re: Import doesn't stop

Post by RBehr »

Actually, before I do this, my command is as follows:

Code: Select all

/opt/otrs/bin/otrs.ImportExport.pl -n 00004 -a import -i /mnt/sun-sql/CRMtoAVSM/SupportedProducts.csv
I am using the -i option. Should I be using -o instead?
Rod Behr
Software Design Manager and Database Analyst | Impact Audiovisual | London
Installation: OTRS 3.0.7, Apache 2, Strawberry Perl 5 on Ubuntu 10.04.3 Server with separate MySQL Server, also on Ubuntu 10.04.3
RBehr
Znuny expert
Posts: 167
Joined: 26 Jan 2011, 13:23
Znuny Version: 3.0.7
Real Name: Rod Behr
Company: Impact
Location: London, United Kingdom
Contact:

Re: Import doesn't stop

Post by RBehr »

Worryingly, this fault seems to have gone away after no action on my part. I cannot re-create the problem, although it was happening daily. I will mark this as solved until it comes back, but this behaviour is worryingly unpredictable.

Obviously something must have changed, but I can identify nothing.

If it happens again I will re-open the ticket.
Rod Behr
Software Design Manager and Database Analyst | Impact Audiovisual | London
Installation: OTRS 3.0.7, Apache 2, Strawberry Perl 5 on Ubuntu 10.04.3 Server with separate MySQL Server, also on Ubuntu 10.04.3
Post Reply