Repository: dmwm/wmcore
Issue: JobAccountant crashes while inserting into wmbs_file_details (data too long)

**Impact of the bug**
Happening only on submit6 for now.

**Describe the bug**
There is a job that produced a LFN longer than what's the current limit of the `lfn` column in `wmbs_file_details`, which is set to 700 chars at the moment.

Here is the file name (715 chars in total):
```
/store/unmerged/logs/prod/2019/8/31/pdmvserv_task_PPD-RunIISummer19UL17wmLHEGEN-00011__v1_T_190827_110710_6213/PPD-RunIISummer19UL17wmLHEGEN-00011_0/PPD-RunIISummer19UL17wmLHEGEN-00011_0MergeRAWSIMoutput/PPD-RunIISummer19UL17SIM-00011_0/PPD-RunIISummer19UL17SIM-00011_0MergeRAWSIMoutput/PPD-RunIISummer19UL17DIGIPremix-00004_0/PPD-RunIISummer19UL17DIGIPremix-00004_0MergePREMIXRAWoutput/PPD-RunIISummer19UL17HLT-00010_0/PPD-RunIISummer19UL17HLT-00010_0MergeRAWSIMoutput/PPD-RunIISummer19UL17RECO-00010_0/PPD-RunIISummer19UL17RECO-00010_0MergeAODSIMoutput/PPD-RunIISummer19UL17MiniAOD-00010_0/PPD-RunIISummer19UL17MiniAOD-00010_0MergeMINIAODSIMoutput/0000/0/27fa01f9-d914-4f4c-912c-0b3e956258be-0-0-logArchive.tar.gz
```

This problem goes along the same lines as what got fixed in this PR:
https://github.com/dmwm/WMCore/pull/9243

**How to reproduce it**

**Expected behavior**
We need to check what are the tables storing an LFN and bump that column to a larger value (I guess 1250 chars is good enough).

**Additional context and error message**
For the record, here is the - misleading due to the first value in the tuple - traceback:
```
2019-09-04 03:48:30,874:140333331478272:ERROR:BaseWorkerThread:Error in worker algorithm (1):
Backtrace:
  <WMComponent.JobAccountant.JobAccountantPoller.JobAccountantPoller object at 0x7fa1e6873310> <@========== WMException Start ==========@>
Exception Class: AccountantWorkerException
Message: Error while adding files to WMBS!
(_mysql_exceptions.DataError) (1406, "Data too long for column 'lfn' at row 20")
[SQL: INSERT INTO wmbs_file_details (lfn, filesize, events,
                                            first_event, merged)
             VALUES (%s, %s, %s, %s,
                     %s)]
[parameters: [('/store/mc
...

Traceback: 
  File "/data/srv/wmagent/v1.2.4.patch2/sw/slc7_amd64_gcc630/cms/wmagent/1.2.4.patch2/lib/python2.7/site-packages/WMComponent/JobAccountant/AccountantWorker.py", line 841, in handleWMBSFiles
    transaction=self.existingTransaction())

  File "/data/srv/wmagent/v1.2.4.patch2/sw/slc7_amd64_gcc630/cms/wmagent/1.2.4.patch2/lib/python2.7/site-packages/WMCore/WMBS/MySQL/Files/Add.py", line 50, in execute
    conn=conn, transaction=transaction)

  File "/data/srv/wmagent/v1.2.4.patch2/sw/slc7_amd64_gcc630/cms/wmagent/1.2.4.patch2/lib/python2.7/site-packages/WMCore/Database/DBCore.py", line 160, in processData
    connection=connection, returnCursor=returnCursor))
....
```

Changed files:
src/python/WMCore/WMBS/CreateWMBSBase.py, src/python/WMCore/WMBS/Oracle/Create.py

diff --git a/src/python/WMCore/WMBS/CreateWMBSBase.py b/src/python/WMCore/WMBS/CreateWMBSBase.py
index 435d9d589..bc9576e33 100644
--- a/src/python/WMCore/WMBS/CreateWMBSBase.py
+++ b/src/python/WMCore/WMBS/CreateWMBSBase.py
@@ -75,7 +75,7 @@ class CreateWMBSBase(DBCreator):
         self.create["02wmbs_file_details"] = \\
             """CREATE TABLE wmbs_file_details (
                id           INTEGER      PRIMARY KEY AUTO_INCREMENT,
-               lfn          VARCHAR(700) NOT NULL,
+               lfn          VARCHAR(1250) NOT NULL,
                filesize     BIGINT,
                events       BIGINT UNSIGNED,
                first_event  BIGINT       UNSIGNED NOT NULL DEFAULT 0,
diff --git a/src/python/WMCore/WMBS/Oracle/Create.py b/src/python/WMCore/WMBS/Oracle/Create.py
index 6739bbcaf..01cc4c4ce 100644
--- a/src/python/WMCore/WMBS/Oracle/Create.py
+++ b/src/python/WMCore/WMBS/Oracle/Create.py
@@ -71,7 +71,7 @@ class Create(CreateWMBSBase):
         self.create["02wmbs_file_details"] = \\
             """CREATE TABLE wmbs_file_details (
                  id          INTEGER NOT NULL,
-                 lfn         VARCHAR(700) NOT NULL,
+                 lfn         VARCHAR(1250) NOT NULL,
                  filesize    INTEGER,
                  events      INTEGER,
                  first_event INTEGER      DEFAULT 0,