Closed yuyiguo closed 4 years ago
Fixed with commit: 607532e5..a07768fb
I was not aware that event_count and file_size may be stored as string data types. The changes I placed in a code check for data types and their validity in this context.
the PR is this: https://github.com/dmwm/DBS/pull/621
Event count and file size are int in the DB, but they were string when they pass to DBS server from input url. Please check you handle all other similar data correctly.
Yuyi, I checked the code and there is NO more places where casting should be done. The evt/size are the only attributes which required the cast.
On 0, Yuyi Guo notifications@github.com wrote:
Event count and file size are int in the DB, but they were string when they pass to DBS server from input url. Please check you handle all other similar data correctly.
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dmwm/DBS/issues/620#issuecomment-576919466
Thanks, I will rebuild with a new tag. Yuyi
From: Valentin Kuznetsov notifications@github.com Reply-To: dmwm/DBS reply@reply.github.com Date: Tuesday, January 21, 2020 at 5:30 PM To: dmwm/DBS DBS@noreply.github.com Cc: Yuyi Guo yuyi@fnal.gov, Author author@noreply.github.com Subject: Re: [dmwm/DBS] Errors from "DBS configuration for NATS integration #821" (#620)
Yuyi, I checked the code and there is NO more places where casting should be done. The evt/size are the only attributes which required the cast.
On 0, Yuyi Guo notifications@github.com wrote:
Event count and file size are int in the DB, but they were string when they pass to DBS server from input url. Please check you handle all other similar data correctly.
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dmwm/DBS/issues/620#issuecomment-576919466https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dmwm_DBS_issues_620-23issuecomment-2D576919466&d=DwQCaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=8bursUuc0V63OwREQMBG2Q&m=U6CIgJW7r1OgBAKZDeS4-uiMGnqB7aHpv72ith_YxOg&s=LqyeAr-Rm6ocxlw8C3Me3nNar7n2HZtllWRyLZ3rSHs&e=
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dmwm_DBS_issues_620-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAANROTS3NIJTRUOZKBGTZVLQ66ARLA5CNFSM4KJ3W3V2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJRVQPQ-23issuecomment-2D576935998&d=DwMCaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=8bursUuc0V63OwREQMBG2Q&m=U6CIgJW7r1OgBAKZDeS4-uiMGnqB7aHpv72ith_YxOg&s=7yHm-SPuAqTvuM9wPUJCEaRwU3xkY5Cn2bIY-yd5z0s&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AANROTWO66GAINB4WXWENS3Q66ARLANCNFSM4KJ3W3VQ&d=DwMCaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=8bursUuc0V63OwREQMBG2Q&m=U6CIgJW7r1OgBAKZDeS4-uiMGnqB7aHpv72ith_YxOg&s=EhLHu-kMVU4tq7hx9qISVbd2Je78Cz56ItRYnSKzb9w&e=.
@vkuznet ,
Please get it correctly.
File "/data/srv/HG2002c/sw.yuyi/slc7_amd64_gcc630/cms/dbs3/3.11.1/lib/python2.7/site-packages/dbs/web/DBSWriterModel.py", line 429 if ecount && ecount != None and str(ecount) != "None": ^
Yuyi, sorry multiple languages/tasks. The fix is here: https://github.com/dmwm/DBS/pull/622
@vkuznet
Please fix the error below and go over the NATS code to fix all similar code. Thanks, Yuyi
test07a: web.DBSWriterModel.insertFiles: basic test ... REQUEST [21/Jan/2020 23:00:28] 127.0.0.1 1111 POST / [] [{}] Tue Jan 21 22:00:28 2020 dbsException-server-error: DBSWriterModel/insertFile. unsupported operand type(s) for +=: 'int' and 'str' . Exception trace: Traceback (most recent call last): File "/data/srv/HG2002c/sw.yuyi/slc7_amd64_gcc630/cms/dbs3/3.11.0/lib/python2.7/site-packages/dbs/web/DBSWriterModel.py", line 428, in insertFile tot_evts += f.get('event_count', 0) TypeError: unsupported operand type(s) for +=: 'int' and 'str'