Bacula-users

Re: [Bacula-users] Could not create JobMedia record

2010-04-13 10:09:56
Subject: Re: [Bacula-users] Could not create JobMedia record
From: Martin Simmons <martin AT lispworks DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 13 Apr 2010 15:07:41 +0100
>>>>> On Tue, 13 Apr 2010 04:08:03 -0400, ladolf  said:
> 
> I am trying to import tape data to bacula catalog using bscan:
> bscan -b mju3-fd_MJU-TED2.bsr -m -n bacula -u bacula  -P bacula -h localhost 
> -s -S -v /dev/st0
> 
> I got this error:
> bscan: bscan.c:1245 Could not create JobMedia record. ERR=sql_create.c:156 
> Update Media record UPDATE Media SET EndFile=167, EndBlock=27602 WHERE 
> MediaId=0 failed: ERR=
> 
> This is whole log:
> bacula:~ # bscan -b /root/bacula/mju1-fd_MJU-MES3.bsr -m -n bacula -u bacula 
> -P bacula -s -S -v /dev/st0
> bscan: butil.c:282 Using device: "/dev/st0" for reading.
> 13-Apr 08:17 bscan JobId 0: Ready to read from volume "MJU-MES3" on device 
> "LTO3Drive" (/dev/st0).
> bscan: bscan.c:297 First Volume Size = 0
> bscan: bscan.c:309 Using Database: bacula, User: bacula
> 13-Apr 08:17 bscan JobId 0: Forward spacing Volume "MJU-MES3" to file:block 
> 0:1.
> bscan: bscan.c:521 SOS_LABEL: Found Job record for JobId: 375
> ...
> bscan: bscan.c:689 1,572,864 file records. At file:blk=165:13,267 
> bytes=330,660,788,028
> bscan: bscan.c:1037 Fileset "MJU_NSS" already exists.
> bscan: bscan.c:1152 Could not update JobId=328 record. ERR=sql_update.c:196 
> Update failed: affected_rows=0 for UPDATE Job SET 
> JobStatus='T',EndTime='2010-03-30 
> 05:21:18',ClientId=2,JobBytes=335474793333,ReadBytes=0,JobFiles=1594852,JobErrors=0,VolSessionId=43,VolSessionTime=1268211453,PoolId=0,FileSetId=9,JobTDate=1269919278,RealEndTime='2010-03-30
>  05:21:18',PriorJobId=0 WHERE JobId=328
> 
> bscan: bscan.c:1245 Could not create JobMedia record. ERR=sql_create.c:156 
> Update Media record UPDATE Media SET EndFile=167, EndBlock=27602 WHERE 
> MediaId=0 failed: ERR=

What is in the bsr file?  Also, I notice that you have two different bsr files
in the command lines above.  Do you have any bsr files that work?

BTW, I hope you aren't using /dev/st0 in your bacula-sd.conf -- it should be
/dev/nst0, otherwise the start of the tape might be overwritten if you run
more than one job.

__Martin

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users