bpsmith / tia

Toolkit for integration and analysis
BSD 3-Clause "New" or "Revised" License
404 stars 165 forks source link

No_AUTH INVALID_USER #32

Closed silgon closed 6 years ago

silgon commented 6 years ago

I recently changed the BBL account and this is appearing.

Traceback (most recent call last):
  File "<input>", line 47, in <module>
  File "C:\Apps\Python\2.7.11.x86\lib\site-packages\tia\bbg\datamgr.py", line 97, in get_historical
    return self.mgr.get_historical(self.sids, flds, start, end, period, **overrides)
  File "C:\Apps\Python\2.7.11.x86\lib\site-packages\tia\bbg\datamgr.py", line 153, in get_historical
    frame = self.terminal.get_historical(sids, flds, start=start, end=end, period=period, **overrides).as_frame()
  File "C:\Apps\Python\2.7.11.x86\lib\site-packages\tia\bbg\v3api.py", line 740, in get_historical
    return self.execute(req)
  File "C:\Apps\Python\2.7.11.x86\lib\site-packages\tia\bbg\v3api.py", line 726, in execute
    request.on_event(evt, is_final=False)
  File "C:\Apps\Python\2.7.11.x86\lib\site-packages\tia\bbg\v3api.py", line 383, in on_event
    for msg in XmlHelper.message_iter(evt):
  File "C:\Apps\Python\2.7.11.x86\lib\site-packages\tia\bbg\v3api.py", line 45, in message_iter
    raise Exception(msg.toString())
Exception: HistoricalDataResponse = {
    responseError = {
        source = "bbdbh3"
        code = 4019
        category = "NO_AUTH"
        message = "parmcm error with rcode: 4019 [nid:704] "
        subcategory = "INVALID_USER"
    }
}

The important part of the code

mgr = dm.BbgDataManager()
startDate = datetime(1990, 1, 1)
endDate = datetime.today().date() - timedelta(days=1)
indexTickers = mgr[tickers]
data = indexTickers.get_historical(field, startDate, endDate)

Anyone has an idea about what causes the issue?

summerside182 commented 6 years ago

this is a error response from bloomberg. so pretty much tia makes the call to the API and receive this response telling you that your user is invalid. The only way you can fix this is ask bloomberg help desk why you receive the code 4019 error when you make call to the API. they should assist you on how to properly install the api

silgon commented 6 years ago

I just restarted the computer and it worked. I didn't restart after putting the activation code and my account.