Increase max script timeout

Hi there,
I have a situation where there was some built-in automated update (I don’t know which, I only see the error logs of it failing to complete - see below) that complained about not being able to post a transaction in a period we’ve closed. It posted an error log every hour, so I assume it tried running the update every hour. This went on for some months (I know, stupid, but it is what it is).

Tryingto fix it, I took snapshots of the period end it complained of, then opened the period and let it run. Now it complained about the next period after that, and so on, I eventually snapshotted trial balances for every period end, opened all of them, and let it run (so I can see what changed and account for it).

Problem now is it doesn’t complain about any closed period anymore, but indeed runs so long that it times out - which causes the below error.

How can I make this timeout longer? I prefer to change configs rather than code, but if code change is the only way, so be it.

The reason I am hard trying to fix this now is wanting to upgrade to v15 (still on v13, so need to go v14 → v15 and don’t want to carry this incomplete transaction over).

Thank you fro any help.

Traceback (most recent call last):
File “apps/erpnext/erpnext/stock/doctype/repost_item_valuation/”, line 103, in repost
File “apps/erpnext/erpnext/stock/doctype/repost_item_valuation/”, line 127, in repost_sl_entries
allow_negative_stock=doc.allow_negative_stock, via_landed_cost_voucher=doc.via_landed_cost_voucher)
File “apps/erpnext/erpnext/stock/”, line 177, in repost_future_sle
}, allow_negative_stock=allow_negative_stock, via_landed_cost_voucher=via_landed_cost_voucher)
File “apps/erpnext/erpnext/stock/”, line 279, in init
File “apps/erpnext/erpnext/stock/”, line 335, in build
File “apps/erpnext/erpnext/stock/”, line 471, in process_sle
File “apps/erpnext/erpnext/stock/”, line 544, in update_outgoing_rate_on_transaction
self.update_rate_on_stock_entry(sle, outgoing_rate)
File “apps/erpnext/erpnext/stock/”, line 551, in update_rate_on_stock_entry
frappe.db.set_value(“Stock Entry Detail”, sle.voucher_detail_no, “basic_rate”, outgoing_rate)
File “apps/frappe/frappe/database/”, line 689, in set_value
frappe.clear_document_cache(dt, dn)
File “apps/frappe/frappe/”, line 855, in clear_document_cache
cache().hdel(‘document_cache’, key)
File “apps/frappe/frappe/utils/”, line 205, in hdel
super(RedisWrapper, self).hdel(_name, key)
File “env/lib/python3.6/site-packages/redis/”, line 3002, in hdel
return self.execute_command(‘HDEL’, name, *keys)
File “env/lib/python3.6/site-packages/redis/”, line 901, in execute_command
return self.parse_response(conn, command_name, **options)
File “env/lib/python3.6/site-packages/redis/”, line 915, in parse_response
response = connection.read_response()
File “env/lib/python3.6/site-packages/redis/”, line 739, in read_response
response = self._parser.read_response()
File “env/lib/python3.6/site-packages/redis/”, line 470, in read_response
File “env/lib/python3.6/site-packages/redis/”, line 427, in read_from_socket
bufflen = recv_into(self._sock, self._buffer)
File “env/lib/python3.6/site-packages/redis/”, line 75, in recv_into
return sock.recv_into(*args, **kwargs)
File “env/lib/python3.6/site-packages/rq/”, line 64, in handle_death_penalty
‘({0} seconds)’.format(self._timeout))
rq.timeouts.JobTimeoutException: Task exceeded maximum timeout value (1500 seconds)

Update bench config

bench config http_timeout <integer>
ex: bench config http_timeout 6000 # this set as 6000 seconds
bench setup supervisor
bench setup nginx

Restart services (as root)

supervisorctl reload
service nginx reload
1 Like

@Hussein_Almozeiqr This worked perfectly, thank you very much!

1 Like

is there any danger in security if i increase this time?