how does method updateCredentialsForItem1 work - yodlee

How does the method ItemManagementService.updateCredentialsForItem1 work?
what happens if I update the account using wrong credential? will it throw exception?
I added one account into yodlee, then I changed the password of that account. It threw error 402 when I tried to get the transactions. After this, I called this method ItemManagementService.updateCredentialsForItem1(userContext, itemId,true, fieldInfoList.ToArray(),true) to update this account. But this method doesn't threw any exception or error code even I updated it using wrong password.
What should I do to make sure yodlee will tell me the credential is wrong if I update the account using wrong credential?
Thanks a lot.
Yuj

I believe research and experience has told/taught me that you need to pass false as the "start refresh on addition/update" and start the refresh manually
The Workflow is exactly the same whether you add or update.
You add/update:
AddItemForContentService1 (if New) or updateCredentialsForItem1 (if updating credentials).
Then You check if the item can be refreshed and if/when it can Start a refresh and then begin your polling.
You need to check RefreshService.isItemRefreshing (this needs to be false)
Then start the refresh RefreshService.startRefresh7.
Then your standard polling routine which is where you will find out whether the updated credentials worked. Ala, At 10/15 second intervals you need to check the status with RefreshClient.getRefreshInfo passing the content item id.
The return value most notably the RefreshInfo.statusCode which correlates to Gatherer Error codes (see code below) lets you know if there is a problem. 0 is successful.
Below are the C# Enums that I built based upon Java SDK and filling in a few missing values with some tech support. The Values are the same regardless of what language. So it's a good reference as the names semi-make sense.
402 and 419 are the two most common Login error codes. 402 is invalid credentials, 419 means it didn't register them in time. The full list of error codes can be found on Yodlee's site here: https://developer.yodlee.com/FAQs/Error_Codes.
public enum GathererErrorsEnum
{
STATUS_OK = 0,
STATUS_INVALID_GATHERER_REQUEST = 400,
STATUS_NO_CONNECTION = 401,
STATUS_LOGIN_FAILED = 402,
STATUS_INTERNAL_ERROR = 403,
STATUS_LOST_REQUEST = 404,
STATUS_ABORT_REQUEST = 405,
STATUS_PASSWORD_EXPIRED = 406,
STATUS_ACCOUNT_LOCKED = 407,
STATUS_DATA_EXPECTED = 408,
STATUS_SITE_UNAVILABLE = 409,
STATUS_POP3_SERVER_FAILED = 410,
STATUS_SITE_OUT_OF_BUSINESS = 411,
STATUS_SITE_APPLICATION_ERROR = 412,
STATUS_REQUIRED_FIELD_UNAVAILABLE = 413,
STATUS_NO_ACCOUNT_FOUND = 414,
STATUS_SITE_TERMINATED_SESSION = 415,
STATUS_SITE_SESSION_ALREADY_ESTABLISHED = 416,
STATUS_DATA_MODEL_NO_SUPPORT = 417,
STATUS_HTTP_DNS_ERROR = 418,
STATUS_LOGIN_NOT_COMPLETED = 419,
STATUS_SITE_MERGED_ERROR = 420,
STATUS_UNSUPPORTED_LANGUAGE_ERROR = 421,
STATUS_ACCOUNT_CANCELLED = 422,
STATUS_ACCT_INFO_UNAVAILABLE = 423,
STATUS_SITE_DOWN_FOR_MAINTENANCE = 424,
STATUS_SITE_CERTIFICATE_ERROR = 425,
STATUS_SITE_BLOCKING_ERROR = 426,
STATUS_NEW_SPLASH_PAGE = 427,
STATUS_NEW_TERMS_AND_CONDITIONS = 428,
STATUS_UPDATE_INFORMATION_ERROR = 429,
STATUS_SITE_NOT_SUPPORTED = 430,
STATUS_HTTP_FILE_NOT_FOUND_ERROR = 431,
STATUS_HTTP_INTERNAL_SERVER_ERROR = 432,
STATUS_REGISTRATION_PARTIAL_SUCCESS = 433,
STATUS_REGISTRATION_FAILED_ERROR = 434,
STATUS_REGISTRATION_INVALID_DATA = 435,
STATUS_REGISTRATION_ACCOUNT_ALREADY_REGISTERED = 436,
STATUS_REGISTRATION_TIMEOUT = 404,
UNIQUEID_FROM_DATA_SOURCE_ERROR = 475,
ACCOUNT_REQUIRED_FIELDS_NOT_SET = 476,
BILL_REQUIRED_FIELDS_NOT_SET = 477,
STATUS_DUPLICATE_BILL = 478,
STATUS_COULD_NOT_GENERATE_AUTOREGISTER_CREDENTIALS = 479,
STATUS_MAX_REGISTRATION_ATTEMPTS_EXCEEDED = 481,
STATUS_ACCOUNT_REGISTERED_ELSE_WHERE = 484,
STATUS_REGISTRATION_BOT_SUPPORTED_FOR_REGION = 485,
STATUS_REGISTRATION_NOT_SUPPORTED_FOR_REGION = 485,
STATUS_UNSUPPORTED_REGISTRATION_ACCOUNT_TYPE = 486,
REWARDS_PROGRAM_REQUIRED_FIELDS_NOT_SET = 491,
REWARDS_ACTIVITY_REQUIRED_FIELDS_NOT_SET = 492,
TAX_LOT_REQUIRED_FIELDS_NOT_SET = 493,
INVESTMENT_TRANSACTION_REQUIRED_FIELDS_NOT_SET = 494,
LOAN_TRANSACTION_REQUIRED_FIELDS_NOT_SET = 495,
CARD_TRANSACTION_REQUIRED_FIELDS_NOT_SET = 496,
BANK_TRANSACTION_REQUIRED_FIELDS_NOT_SET = 497,
HOLDING_REQUIRED_FIELDS_NOT_SET = 498,
SITE_CURRENTLY_NOT_SUPPORTED = 505,
NEW_LOGIN_INFO_REQUIRED_FOR_SITE = 506,
BETA_SITE_WORK_IN_PROGRESS = 507,
STATUS_INSTANT_REQUEST_TIMEDOUT = 508,
TOKEN_ID_INVALID = 509,
PROPERTY_RECORD_NOT_FOUND = 510,
HOME_VALUE_NOT_FOUND = 511,
NO_PAYEE_FOUND = 512,
NO_PAYEE_RETRIEVED = 513,
SOME_PAYEE_NOT_RETRIEVED = 514,
NO_PAYMENT_ACCOUNT_FOUND = 515,
NO_PAYMENT_ACCOUNT_SELECTED = 516,
GENERAL_EXCEPTION_WHILE_GATHERING_MFA_DATA = 517,
NEW_MFA_INFO_REQUIRED_FOR_AGENTS = 518,
MFA_INFO_NOT_PROVIDED_TO_YODLEE_BY_USER_FOR_AGENTS = 519,
MFA_INFO_MISMATCH_FOR_AGENTS = 520,
ENROLL_IN_MFA_AT_SITE = 521,
MFA_INFO_NOT_PROVIDED_IN_REAL_TIME_BY_USER_VIA_APP = 522,
INVALID_MFA_INFO_IN_REAL_TIME_BY_USER_VIA_APP = 523,
USER_PROVIDED_REAL_TIME_MFA_DATA_EXPIRED = 524,
MFA_INFO_NOT_PROVIDED_IN_REAL_TIME_BY_GATHERER = 525,
INVALID_MFA_INFO_OR_CREDENTIALS = 526,
STATUS_DBFILER_SUMMARY_SAVE_ERROR = 601,
STATUS_REQUEST_GENERATION_ERROR = 602,
STATUS_REQUEST_DISPATCH_ERROR = 603,
STATUS_REQUEST_GENERATION_ERROR_LOGIN_FAILURE = 604,
STATUS_REQUEST_GENERATION_ERROR_DELETED_ITEM = 605,
INPUT_INVALID_DATA = 701,
INPUT_LENGTH_ERROR = 702,
INPUT_FORMAT_ERROR = 703,
INPUT_USERNAME_ALREADY_TAKEN_ERROR = 704,
INPUT_VALUE_TOO_SMALL = 705,
INPUT_VALUE_TOO_LARGE = 706,
REFRESH_NEVER_DONE = 801,
REFRESH_NEVER_DONE_AFTER_CREDENTIALS_UPDATE = 802,
}

Related

solidity ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=7545) #30

Macbook Pro : Monterey
Intel Core i7
Brownie v1.17.2
I am learning solidity according to reference(https://www.youtube.com/watch?v=M576WGiDBdQ&t=25510s).
At youtube freedcodecamp 5:41:17 ,when tried to deploy to ganache-local,pop out these error information.
before refactoring deployed to ganache UI and rinkeby successfully, and i add ganache-local to brownie network this error pop.
ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=7545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd62639d700>: Failed to establish a new connection: [Errno 61] Connection refused'))
full error
BronieFundMe2022Project is the active project.
Running 'scripts/deploy.py::main'...
The active network is ganache-local
Deploying Mocks....
File "brownie/_cli/run.py", line 50, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/deploy.py", line 27, in main
deploy_fund_me()
File "./scripts/deploy.py", line 16, in deploy_fund_me
deploy_mocks()
File "./scripts/helpful_scripts.py", line 20, in deploy_mocks
MockV3Aggregator.deploy(DECIMALS,Web3.toWei(STARTING_PRICE,"ether"),{"from":get_account()})
File "brownie/network/contract.py", line 528, in __call__
return tx["from"].deploy(
File "brownie/network/account.py", line 510, in deploy
receipt, exc = self._make_transaction(
File "brownie/network/account.py", line 720, in _make_transaction
gas_price, gas_strategy, gas_iter = self._gas_price(gas_price)
File "brownie/network/account.py", line 456, in _gas_price
return web3.eth.generate_gas_price(), None, None
File "web3/eth.py", line 877, in generate_gas_price
return self._generate_gas_price(transaction_params)
File "web3/eth.py", line 173, in _generate_gas_price
return self.gasPriceStrategy(self.web3, transaction_params)
File "web3/gas_strategies/rpc.py", line 20, in rpc_gas_price_strategy
return web3.manager.request_blocking(RPC.eth_gasPrice, [])
File "web3/manager.py", line 197, in request_blocking
response = self._make_request(method, params)
File "web3/manager.py", line 150, in _make_request
return request_func(method, params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "web3/middleware/formatting.py", line 76, in apply_formatters
response = make_request(method, params)
File "web3/middleware/gas_price_strategy.py", line 90, in middleware
return make_request(method, params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "web3/middleware/formatting.py", line 76, in apply_formatters
response = make_request(method, params)
File "web3/middleware/attrdict.py", line 33, in middleware
response = make_request(method, params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "web3/middleware/formatting.py", line 76, in apply_formatters
response = make_request(method, params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "web3/middleware/formatting.py", line 76, in apply_formatters
response = make_request(method, params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "web3/middleware/formatting.py", line 76, in apply_formatters
response = make_request(method, params)
File "web3/middleware/buffered_gas_estimate.py", line 40, in middleware
return make_request(method, params)
File "web3/middleware/exception_retry_request.py", line 105, in middleware
return make_request(method, params)
File "web3/providers/rpc.py", line 88, in make_request
raw_response = make_post_request(
File "web3/_utils/request.py", line 48, in make_post_request
response = session.post(endpoint_uri, data=data, *args, **kwargs) # type: ignore
File "requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=7545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd62639d700>: Failed to establish a new connection: [Errno 61] Connection refused'))
deploy scripts
from brownie import FundMe,network,config,MockV3Aggregator
from scripts.helpful_scripts import (deploy_mocks, get_account,LOCAL_BLOCKCHAIN_ENVIRONMENT)
def deploy_fund_me():
account = get_account()
# pass the price feed address to our fundme contract
# if we are on a persistent network like rinkeby, use the associated address
# otherwise, deploy mocks
if network.show_active() not in LOCAL_BLOCKCHAIN_ENVIRONMENT:
price_feed_address = config["network"][network_showactive()]["eth_usd_price_feed"]
else:
deploy_mocks()
price_feed_address = MockV3Aggregator[-1].address
fund_me = FundMe.deploy(
price_feed_address,
{"from":account},
publish_source=config["networks"][network.show_active()].get("verify"),
)
print(f"The contract deploy to {fund_me.address}")
def main():
deploy_fund_me()
Problem fixed by using "brownie networks delete ganache-local" ,then add the network again.
and set the ganache port to 8545, chainid to 1337
and reboot .
Run "brownie accounts delete (name of account you stored the Ganache address)
Then run your Ganache normally
if 0.0.0.0 doesn't work, try 127.0.0.1, because a server with 0.0.0.0 address will accept connections on 127.0.0.1 too
for example:
brownie networks add Ethereum ganache-local host=http://127.0.0.1:8545 chainid=1337

Why does a requests.exceptions.ReadTimeout errors happens when executing (heavy?) code in ganache using web3py?

I'm trying to generate a sorted list of random uint32 numbers. Generating the list is easily done:
for (uint24 i = 1; i < limit; i++) {
seed = uint(keccak256(abi.encodePacked(seed)));
sorted[i] = uint32(seed);
}
where limit is an uint24 indicating the number of samples, seed is an arbitrary uint and sampled is an uint32[limit]. However, if I try to generate a sorted array like this:
for (uint24 i = 1; i < limit; i++) {
seed = uint(keccak256(abi.encodePacked(seed)));
sorted[i] = uint32(seed);
uint24 j = i;
while (sorted[j - 1] > sorted[j]) {
(sorted[j - 1], sorted[j]) = (sorted[j], sorted[j - 1]);
j--;
if (j == 0) {
break;
}
}
}
then this yields the expected result for small values of limit (like 10), but web3py fails with the following error for bigger inputs (like 300) when I try to call the function associated with the previous code:
Traceback (most recent call last):
File "/home/personal/Python/venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/home/personal/Python/venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.9/http/client.py", line 1371, in getresponse
response.begin()
File "/usr/lib/python3.9/http/client.py", line 319, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.9/http/client.py", line 280, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/personal/Python/venv/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/home/personal/Python/venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/home/personal/Python/venv/lib/python3.9/site-packages/urllib3/util/retry.py", line 532, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/personal/Python/venv/lib/python3.9/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/home/personal/Python/venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/home/personal/Python/venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 447, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/home/personal/Python/venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=8545): Read timed out. (read timeout=10)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/contract.py", line 957, in call
return call_contract_function(
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/contract.py", line 1501, in call_contract_function
return_data = web3.eth.call(
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/module.py", line 57, in caller
result = w3.manager.request_blocking(method_str,
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/manager.py", line 186, in request_blocking
response = self._make_request(method, params)
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/manager.py", line 147, in _make_request
return request_func(method, params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
response = make_request(method, params)
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/gas_price_strategy.py", line 90, in middleware
return make_request(method, params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/formatting.py", line 74, in apply_formatters
response = make_request(method, formatted_params)
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/attrdict.py", line 33, in middleware
response = make_request(method, params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/formatting.py", line 74, in apply_formatters
response = make_request(method, formatted_params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/formatting.py", line 74, in apply_formatters
response = make_request(method, formatted_params)
File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/formatting.py", line 74, in apply_formatters
response = make_request(method, formatted_params)
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/buffered_gas_estimate.py", line 40, in middleware
return make_request(method, params)
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/middleware/exception_retry_request.py", line 105, in middleware
return make_request(method, params)
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/providers/rpc.py", line 88, in make_request
raw_response = make_post_request(
File "/home/personal/Python/venv/lib/python3.9/site-packages/web3/_utils/request.py", line 48, in make_post_request
response = session.post(endpoint_uri, data=data, *args, **kwargs) # type: ignore
File "/home/personal/Python/venv/lib/python3.9/site-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/home/personal/Python/venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/home/personal/Python/venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/home/personal/Python/venv/lib/python3.9/site-packages/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=8545): Read timed out. (read timeout=10)
I guess that Ganache is quite busy and that's why it can't answer fast enough for web3py to be satisfied, but the added code doesn't seem so heavy that it cannot be dealt with. Or do I miss something else that makes this code too heavy for Ganache?
you can set timeout in your Web3py http provider:
Web3(Web3.HTTPProvider(endpoint_uri=http://127.0.0.1:8545,request_kwargs={'timeout': 600})

Odoo crashes when creating several records at the same time

I have created a method where I import a csv file and I create new records with the data it contains. The method works with as csv with around 1000 lines. (The method can create around 1000 new records), but when the csv file have more than 1200 lines, Odoo server crashes and I have to restart the server. Here is my method and the odoo log
#api.multi
#profile
def action_import_csv(self):
cuenta = 0
self._chequear_extension_csv(self.archivo_filename)
res = base64.b64decode(self.archivo)
text = res.decode("UTF-8")
reader = csv.DictReader(io.StringIO(text))
brigadista = self.env['utepda_brigadas.brigadista']
brigada = self.env['utepda_brigadas.brigada']
brigada_cr = self.env.cr
brigadista_brigada = self.env['utepda_brigadas.brigadista_brigada']
count = 0
campos = [
'BRIGADA', 'NOMBRE', 'CEDULA', 'CARGO', 'JORNALES', 'COSTO_JORNADA'
]
rows = list(reader)
totalrows = len(rows)
print("La cantidad de filas es {}".format(totalrows))
for index,row in enumerate(rows):
print("Index -> {} -> {}".format(index,row))
if count == 0:
count = 1
self._chequear_campos_csv(campos, row.keys())
else:
codigo_brigada = row['BRIGADA']
nombre = row['NOMBRE']
cedula = row['CEDULA'].replace('-', '')
cargo = row['CARGO']
dias_trabajados = row['JORNALES']
total_jornada = row['COSTO_JORNADA']
fecha = self.fecha
total = int(dias_trabajados) * int(total_jornada)
existe_brigadista = brigadista.search([['cedula', '=', cedula]],limit=1)
brigada_actual = brigada.search([['codigo', '=', codigo_brigada]],limit=1)
#brigada_cr.execute(
# "SELECT id FROM public.utepda_brigada_brigada WHERE codigo=%s"
# % codigo_brigada)
#res = brigada_cr.fetchone()
#brigada_actual = brigada.search([['codigo', '=', codigo_brigada]],
#limit=1)
#brigada_actual = res[0]
if not existe_brigadista.id:
new = {
'name':
nombre,
'cedula':
cedula,
'cargo':
cargo,
'estado':
"nuevo",
'brigada_ids': [(0, _, {
'fecha': fecha,
'dias_trabajados': dias_trabajados,
'total': total,
'brigada_id': brigada_actual.id
})]
}
nuevo_brigadista = brigadista.create(new)
if nuevo_brigadista.id:
cuenta = cuenta+1
print("""{} Se ha insertado el brigadista {} con nombre {}""".format(cuenta,nuevo_brigadista.id,
nuevo_brigadista.name))
#existe_brigadista = existe_brigadista[0]
else:
existe_brigadista.write({
'estado':
"reportado",
'brigada_ids': [(0, _, {
'fecha': fecha,
'dias_trabajados': dias_trabajados,
'total': total,
'brigada_id': brigada_actual.id
})]
})
fecha_format = datetime.strftime(self.fecha, '%m/%Y')
no_reportados = brigadista.search(
[['fecha_ultimo_reporte', '!=', fecha_format]])
no_reportados.write({'estado': "no_reportado"})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}
Here is the Odoo log
2020-11-04 11:44:23,285 15044 WARNING odoo odoo.service.server: Thread <Thread(odoo.service.http.request.140355723687680, started 140355723687680)> virtual real time limit (152/120s) reached.
2020-11-04 11:44:23,289 15044 INFO odoo odoo.service.server: Dumping stacktrace of limit exceeding threads before reloading
2020-11-04 11:44:23,520 15044 INFO odoo odoo.tools.misc:
# Thread: <Thread(odoo.service.http.request.140355723687680, started 140355723687680)> (db:odoo) (uid:2) (url:http://localhost:8069/web/dataset/call_button)
File: "/home/ernesto/.vscode/extensions/ms-python.python-2020.5.86806/pythonFiles/lib/python/debugpy/no_wheels/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py", line 823, in __call__
ret = self.original_func(*self.args, **self.kwargs)
File: "/usr/lib/python3.6/threading.py", line 884, in _bootstrap
self._bootstrap_inner()
File: "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File: "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File: "/usr/lib/python3.6/socketserver.py", line 654, in process_request_thread
self.finish_request(request, client_address)
File: "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File: "/usr/lib/python3.6/socketserver.py", line 724, in __init__
self.handle()
File: "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 228, in handle
rv = BaseHTTPRequestHandler.handle(self)
File: "/usr/lib/python3.6/http/server.py", line 418, in handle
self.handle_one_request()
File: "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 263, in handle_one_request
return self.run_wsgi()
File: "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 205, in run_wsgi
execute(self.server.app)
File: "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 193, in execute
application_iter = app(environ, start_response)
File: "/home/ernesto/odoo12/odoo/service/server.py", line 434, in app
return self.app(e, s)
File: "/home/ernesto/odoo12/odoo/service/wsgi_server.py", line 142, in application
return application_unproxied(environ, start_response)
File: "/home/ernesto/odoo12/odoo/service/wsgi_server.py", line 117, in application_unproxied
result = odoo.http.root(environ, start_response)
File: "/home/ernesto/odoo12/odoo/http.py", line 1320, in __call__
return self.dispatch(environ, start_response)
File: "/home/ernesto/odoo12/odoo/http.py", line 1293, in __call__
return self.app(environ, start_wrapped)
File: "/usr/local/lib/python3.6/dist-packages/werkzeug/wsgi.py", line 599, in __call__
return self.app(environ, start_response)
File: "/home/ernesto/odoo12/odoo/http.py", line 1488, in dispatch
result = ir_http._dispatch()
File: "/home/ernesto/odoo12/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
return super(Http, cls)._dispatch()
File: "/home/ernesto/odoo12/addons/web_editor/models/ir_http.py", line 22, in _dispatch
return super(IrHttp, cls)._dispatch()
File: "/home/ernesto/odoo12/odoo/addons/base/models/ir_http.py", line 203, in _dispatch
result = request.dispatch()
File: "/home/ernesto/odoo12/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File: "/home/ernesto/odoo12/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File: "/home/ernesto/odoo12/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File: "/home/ernesto/odoo12/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File: "/home/ernesto/odoo12/odoo/http.py", line 941, in __call__
return self.method(*args, **kw)
File: "/home/ernesto/odoo12/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File: "/home/ernesto/odoo12/addons/web/controllers/main.py", line 966, in call_button
action = self._call_kw(model, method, args, {})
File: "/home/ernesto/odoo12/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File: "/home/ernesto/odoo12/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File: "/home/ernesto/odoo12/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File: "<decorator-gen-127>", line 2, in action_import_csv
File: "/home/ernesto/odoo12/odoo/tools/profiler.py", line 128, in _odooProfile
result = method(*args, **kwargs)
File: "/home/ernesto/odoo12/extra_addons/utepda_brigadas/models/model_wizard.py", line 81, in action_import_csv
nuevo_brigadista = brigadista.create(new)
File: "<decorator-gen-111>", line 2, in create
File: "/home/ernesto/odoo12/odoo/api.py", line 461, in _model_create_multi
return create(self, [arg])
File: "/home/ernesto/odoo12/addons/mail/models/mail_thread.py", line 278, in create
thread._message_log(body=_('%s created') % doc_name)
File: "/home/ernesto/odoo12/addons/mail/models/mail_thread.py", line 2230, in _message_log
message = self.env['mail.message'].sudo().create(message_values)
File: "<decorator-gen-107>", line 2, in create
File: "/home/ernesto/odoo12/odoo/api.py", line 440, in _model_create_single
return create(self, arg)
File: "/home/ernesto/odoo12/addons/mail/models/mail_message.py", line 990, in create
message = super(Message, self).create(values)
File: "<decorator-gen-3>", line 2, in create
File: "/home/ernesto/odoo12/odoo/api.py", line 461, in _model_create_multi
return create(self, [arg])
File: "/home/ernesto/odoo12/odoo/models.py", line 3583, in create
records = self._create(data_list)
File: "/home/ernesto/odoo12/odoo/models.py", line 3669, in _create
col_val = field.convert_to_column(val, self, stored)
File: "/home/ernesto/odoo12/odoo/fields.py", line 1555, in convert_to_column
strip_classes=self.strip_classes)
File: "/home/ernesto/odoo12/odoo/tools/mail.py", line 227, in html_sanitize
cleaned = cleaner.clean_html(src)
File: "/usr/local/lib/python3.6/dist-packages/lxml/html/clean.py", line 517, in clean_html
doc = fromstring(html)
File: "/usr/local/lib/python3.6/dist-packages/lxml/html/__init__.py", line 876, in fromstring
doc = document_fromstring(html, parser=parser, base_url=base_url, **kw)
File: "/usr/local/lib/python3.6/dist-packages/lxml/html/__init__.py", line 762, in document_fromstring
value = etree.fromstring(html, parser, **kw)
2020-11-04 11:44:23,522 15044 INFO odoo odoo.service.server: Initiating server reload
It's probably timing out due to the sheer amount of records. Add the following to your config file, but play around with the settings to see what works best for you.
--limit-time-real 10000
limit_time_real = 480
I would also increase workers if you can to not slow down the Odoo
https://www.odoo.com/documentation/14.0/setup/deploy.html#builtin-server

Running into uvloop issues with Database queries from Rasa-X?

I'm trying to make a simple query to my amazon neptune database, from Rasa-x.
Here is the code from my actions.py:
class ActionQueryDietary(Action):
def name(self) -> Text:
return "action_query_dietary"
def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
available = False
restaurant = "XXXX"
dietaryQuestion=tracker.get_slot('dietaryQuestion')
g, remoteConn = kb.openConnection()
dietary = kb.getDietary(g, restaurant, dietaryQuestion)
if(dietary=="Yes"):
available = True
if(available==True):
dispatcher.utter_message(text="According to our knowledge base, {} is on the menu").format(dietaryQuestion)
else:
dispatcher.utter_message(text="Sorry, according to our knowledge base, we don't have this option on the menu")
kb.closeConnection(remoteConn)
return []
and here is the code from knowledgebase.py:
def getDietary(g, restaurant, dietary):
properties = queryRestaurantProperties(g, restaurant)
result = properties[dietary]
print(result)
return result
but any query to the knowledgebase results in this error:
2020-10-22T18:01:22.347345241Z File "/opt/venv/lib/python3.7/site-packages/sanic/app.py", line 973, in handle_request
2020-10-22T18:01:22.347351643Z response = await response
2020-10-22T18:01:22.347357446Z File "/app/rasa_sdk/endpoint.py", line 102, in webhook
2020-10-22T18:01:22.347363522Z result = await executor.run(action_call)
2020-10-22T18:01:22.347369398Z File "/app/rasa_sdk/executor.py", line 392, in run
2020-10-22T18:01:22.347375473Z events = action(dispatcher, tracker, domain)
2020-10-22T18:01:22.347381348Z File "/app/actions/actions.py", line 33, in run
2020-10-22T18:01:22.347387063Z dietary = kb.getDietary(g, restaurant, dietaryQuestion)
2020-10-22T18:01:22.347392835Z File "/app/actions/knowledgebase.py", line 117, in getDietary
2020-10-22T18:01:22.347399112Z properties = queryRestaurantProperties(g, restaurant)
2020-10-22T18:01:22.347405111Z File "/app/actions/knowledgebase.py", line 86, in queryRestaurantProperties
2020-10-22T18:01:22.347411869Z result = g.V().has('name', restaurant).valueMap().next()
2020-10-22T18:01:22.347418048Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/process/traversal.py", line 89, in next
2020-10-22T18:01:22.347424293Z return self.__next__()
2020-10-22T18:01:22.347430069Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/process/traversal.py", line 48, in __next__
2020-10-22T18:01:22.347436333Z self.traversal_strategies.apply_strategies(self)
2020-10-22T18:01:22.347441940Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/process/traversal.py", line 573, in apply_strategies
2020-10-22T18:01:22.347447667Z traversal_strategy.apply(traversal)
2020-10-22T18:01:22.347453031Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/driver/remote_connection.py", line 149, in apply
2020-10-22T18:01:22.347459352Z remote_traversal = self.remote_connection.submit(traversal.bytecode)
2020-10-22T18:01:22.347465069Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/driver/driver_remote_connection.py", line 55, in submit
2020-10-22T18:01:22.347486749Z result_set = self._client.submit(bytecode)
2020-10-22T18:01:22.347493788Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/driver/client.py", line 127, in submit
2020-10-22T18:01:22.347499424Z return self.submitAsync(message, bindings=bindings).result()
2020-10-22T18:01:22.347505093Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/driver/client.py", line 146, in submitAsync
2020-10-22T18:01:22.347511092Z return conn.write(message)
2020-10-22T18:01:22.347516610Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/driver/connection.py", line 55, in write
2020-10-22T18:01:22.347522673Z self.connect()
2020-10-22T18:01:22.347529987Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/driver/connection.py", line 45, in connect
2020-10-22T18:01:22.347536097Z self._transport.connect(self._url, self._headers)
2020-10-22T18:01:22.347542222Z File "/opt/venv/lib/python3.7/site-packages/gremlin_python/driver/tornado/transport.py", line 36, in connect
2020-10-22T18:01:22.347547822Z lambda: websocket.websocket_connect(url))
2020-10-22T18:01:22.347553477Z File "/opt/venv/lib/python3.7/site-packages/tornado/ioloop.py", line 571, in run_sync
2020-10-22T18:01:22.347559295Z self.start()
2020-10-22T18:01:22.347564864Z File "/opt/venv/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 132, in start
2020-10-22T18:01:22.347570978Z self.asyncio_loop.run_forever()
2020-10-22T18:01:22.347576693Z File "uvloop/loop.pyx", line 1351, in uvloop.loop.Loop.run_forever
2020-10-22T18:01:22.347582342Z File "uvloop/loop.pyx", line 484, in uvloop.loop.Loop._run
2020-10-22T18:01:22.347588222Z RuntimeError: Cannot run the event loop while another loop is running
I tried using nest_asyncio.apply, but that resulted in this error:
ValueError: Can't patch loop of type <class 'uvloop.Loop'>
which according to the docs is just a rule.
So I don't really know how to proceed?
Adding my comment above as an answer. In some cases it is necessary to downlevel the version of Tornado being used. There are some issues that you can sometimes run into if the event loop is already running when someone else tries to create it. For now, down leveling to Tornado 4.5.1 with Gremlin Python should resolve any issues.

hg push error and username not specified in .hg/hgrc. Keyring will not be used

I did the following:
hg clone ...somelink.to.repo.in.hg... Giga
cd Giga
ls (...it shows me giga.txt file exist in Giga directory)
vi giga.txt (...made some changes..)
hg commit -m "byte"
hg out (got the following error)
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial#selenic.com
** Mercurial Distributed SCM (version 1.5)
** Extensions loaded: acl, bugzilla, children, churn, color, convert, extdiff, fetch, gpg, graphlog, hgcia, hgk, highlight, interhg, keyword, mercurial_keyring, mq, notify, pager, patchbomb, progress, purge, rebase, record, relink, schemes, share, transplant, zeroconf
Traceback (most recent call last):
File "/usr/bin/hg", line 27, in <module>
mercurial.dispatch.run()
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
sys.exit(dispatch(sys.argv[1:]))
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 30, in dispatch
return _runcatch(u, args)
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 47, in _runcatch
return _dispatch(ui, args)
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 466, in _dispatch
return runcommand(lui, repo, cmd, fullargs, ui, options, d)
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 336, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python2.6/site-packages/mercurial/extensions.py", line 128, in wrap
return wrapper(origfn, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/hgext/pager.py", line 66, in pagecmd
return orig(ui, options, cmd, cmdfunc)
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 517, in _runcommand
return checkargs()
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 471, in checkargs
return cmdfunc()
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 465, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/extensions.py", line 116, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/hgext/color.py", line 352, in nocolor
return orig(*args, **opts)
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/extensions.py", line 116, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/hgext/mq.py", line 2648, in mqcommand
return orig(ui, repo, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/extensions.py", line 116, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/hgext/graphlog.py", line 365, in graph
return orig(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/commands.py", line 2275, in outgoing
other = hg.repository(cmdutil.remoteui(repo, opts), dest)
File "/usr/lib/python2.6/site-packages/mercurial/hg.py", line 82, in repository
repo = _lookup(path).instance(ui, path, create)
File "/usr/lib/python2.6/site-packages/mercurial/httprepo.py", line 271, in instance
inst.between([(nullid, nullid)])
File "/usr/lib/python2.6/site-packages/mercurial/httprepo.py", line 190, in between
d = self.do_read("between", pairs=n)
File "/usr/lib/python2.6/site-packages/mercurial/httprepo.py", line 134, in do_read
fp = self.do_cmd(cmd, **args)
File "/usr/lib/python2.6/site-packages/mercurial/httprepo.py", line 85, in do_cmd
resp = self.urlopener.open(req)
File "/usr/lib/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.6/urllib2.py", line 429, in error
result = self._call_chain(*args)
File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib/python2.6/urllib2.py", line 855, in http_error_401
url, req, headers)
File "build/bdist.linux-i686/egg/mercurial_keyring.py", line 339, in basic_http_error_auth_reqed
File "/usr/lib/python2.6/urllib2.py", line 833, in http_error_auth_reqed
return self.retry_http_basic_auth(host, req, realm)
File "/usr/lib/python2.6/urllib2.py", line 836, in retry_http_basic_auth
user, pw = self.passwd.find_user_password(realm, host)
File "build/bdist.linux-i686/egg/mercurial_keyring.py", line 333, in find_user_password
File "build/bdist.linux-i686/egg/mercurial_keyring.py", line 184, in find_auth
File "build/bdist.linux-i686/egg/mercurial_keyring.py", line 67, in get_http_password
File "/usr/local/lib/python2.6/site-packages/keyring/core.py", line 37, in get_password
return _keyring_backend.get_password(service_name, username)
File "/usr/local/lib/python2.6/site-packages/keyring/backend.py", line 143, in get_password
items = gnomekeyring.find_network_password_sync(username, service)
gnomekeyring.IOError
My ~/.hgrc (OpenSUSE machine)
[ui]
username=c123456 <Arun.Sangal#MyCompany.com>
[extensions]
mercurial_keyring = /root/mercurial_keyring.py
#[trusted]
#users = *
#groups = *
[extensions]
acl =
bugzilla =
children =
churn =
color =
convert =
eol = !
extdiff =
factotum = !
fetch =
gpg =
graphlog =
hgcia =
hgcr-gui-qt = !
hgk =
highlight =
interhg =
keyword =
largefiles = !
mercurial_keyring =
mq =
notify =
pager =
patchbomb =
perfarce = !
progress =
projrc = !
purge =
rebase =
record =
relink =
schemes =
....
........etc
My local repository
(on OpenSuse cloned folder - inside: /Giga/.hg/hgrc) is:
[paths]
default = http://the.hg.server.com/hg/TestHgRepo1/
myrepo = http://the.hg.server.com/hg/TestHgRepo1/
[auth]
myrepo.schemes = http https
myrepo.prefix = the.hg.server.com/hg
myrepo.username = c123456
I tried everything but this Keyring thing is not working. I get prompt everytime I do:
hg out
hg push
etc hg operation but not when I do
hg commit
Can someone please tell what the heck I'm missing here. Tried the same excercise on Windows with TortoiseHg, with C:...\mercurial.ini (Windows side kinda of unix ~/.hgrc file).. and updated/made sure local repository cloned folder's ../clonedfolder/.hg/hgrc file contains the similar [auth] ..3 lines but Mercurial on Linux OpenSUSE and on Windows using TortoiseHg is not working with keyring.
It's prompting me for entering user credentials again n again :((
can someone pls correct me on what should I do to get this resolved.
if prompted multiple times for user credentials in mercurial. Setup Mercurial_Keyring and then
this question comes which nobody explained in an easy way.
??? how to make the [auth] xx.prefix = servername/hg_or_something work for all repositories under servername/hg location either if I use servername, servername's IP or servername's FQDN ?
Final ANSWER: Arun • 2 minutes ago −
OK, I put this in ~/.hgrc (Linux/Unix -home directory's .hgrc hidden file) or Windows users %UserProfile%/mercurial.ini or %HOME%/mercurial.ini file.
[auth]
default1.schemes = http https
default1.prefix = hg_merc_server/hg
default1.username = c123456
default2.schemes = http https
default2.prefix = hg_merc_server.company.com/hg
default2.username = c123456
default3.schemes = http https
default3.prefix = 10.211.222.321/hg
default3.username = c123456
Now, I can checkout using either Server/IP/Server's FQDN.