Timeout when trying to run a salary slip (payslip)

I have a test version of ERPNext running on a digital ocean server. I used the install.py on Debian 9 and it worked.

When I attempt to submit a payslip it times out. Would appreciate some guidance, I’m willing to share any tracebacks or errors, just not sure where they are located.

for eg frappe@erpnext:~/frappe-bench$ find logs -name ‘*.log’ | xargs grep pay

Thanks @clarkej,
I ended up doing:

cd logs
grep payment *.log

This is what I’m seeing…

worker.error.log:00:20:01 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'site1.local', user=u'Administrator') (c4d1de7f-bc80-4581-ba8b-3bd242fa9981)
worker.error.log:00:24:01 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'site1.local', user=u'Administrator') (2d531c70-692e-43e6-8594-c0c51b018b91)
worker.error.log:00:28:01 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'site1.local', user=u'Administrator') (b64b573a-523d-40f0-90d6-3c967eceae2c)
worker.error.log:00:32:02 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'site1.local', user=u'Administrator') (94ac579f-3085-48e9-896d-544da27db913)
worker.error.log:00:36:02 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'site1.local', user=u'Administrator') (f772e076-a9ee-4642-af39-0b7032304cdd)
worker.error.log:00:40:02 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'site1.local', user=u'Administrator') (71f98214-846e-46b0-af12-cc066bf6b0fd)
worker.error.log:00:44:03 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'site1.local', user=u'Administrator') (e88eeec2-24d6-41d5-8d46-adcae05ada1d)
worker.error.log:00:48:03 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'site1.local', user=u'Administrator') (17f1945f-292f-4fe8-a2da-7068837b604f)

ok it seems you submit the pay slips to razorpay?

But that ‘payment gateway’ is timing out due to a failed network connection?

If you post a record from the log, that may help confirm and diagnose the source of the problem.

You may want to verify your connection settings with them?

Shows how clueless I am on this. We’re pretty small and we pay manually at the moment, so we’d need to disconnect that gateway, perhaps it was a default setting.

Which doctype do you mean via the payslip?

@ManasSolanki I don’t know anything about doctypes at this point. I installed it using the install.py script and am working with the defaults.
I understand your question to imply that I may need to change one of the default settings in order to be able to manually run payroll. I’ll go and read about doctypes now.

@ManasSolanki Okay… I’m back. I understand doctypes to be schemas that represent different types of “content” in ERPNext (I may be off the mark there).
Based on that context I believe the doctype I’m interested in is “salary_slip” https://erpnext.org/docs/current/models/hr/salary_slip

Does that give any useful context?

Hi @ManasSolanki

Could you please rephrase the question? Even I am not really sure what you mean :grinning:

Thanks

Hi @pigeonflight

It shouldn’t have anything to do with default settings unless its some kind of bug. Hopefully someone can shed some more light on this soon

Cheers

I suppose my question would be something like:

Why a default install of ERPNext attempting to contact razorpay when I try to process a salary slip?
How do I disable or change this behaviour?

@pigeonflight It doesn’t have to do anything with the razorpyay. Check your browser console whether there is any error log. You can also check the request send to the server in the "Network " of browser dev tools.

I tried again and here’s the traceback that I got.

(In case it matters, what’s different since my first post is that I set up a proper domain, changed the site name and enabled SSL via letsencrypt.)

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 19, in savedocs
    doc.submit()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 831, in submit
    self._submit()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 820, in _submit
    self.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 256, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 307, in _save
    self.run_post_save_methods()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 890, in run_post_save_methods
    self.run_method("on_submit")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 755, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1024, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1007, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 749, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 415, in on_submit
    self.email_salary_slip()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 429, in email_salary_slip
    "attachments": [frappe.attach_print(self.doctype, self.name, file_name=self.name)],
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1272, in attach_print
    "fcontent": get_print(doctype, name, print_format=print_format, style=style, html=html, as_pdf=True, doc=doc, no_letterhead=no_letterhead)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1249, in get_print
    return get_pdf(html, output = output)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py", line 17, in get_pdf
    pdfkit.from_string(html, fname, options=options or {})
  File "/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/api.py", line 68, in from_string
    return r.to_pdf(output_path)
  File "/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py", line 140, in to_pdf
    raise IOError('wkhtmltopdf reported an error:\n' + stderr.decode('utf-8'))
IOError: wkhtmltopdf reported an error:
QSslSocket: cannot resolve CRYPTO_num_locks
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv3_server_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
Exit with code 1 due to network error: UnknownNetworkError
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback


Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 62, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 939, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 19, in savedocs
    doc.submit()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 831, in submit
    self._submit()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 820, in _submit
    self.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 256, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 307, in _save
    self.run_post_save_methods()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 890, in run_post_save_methods
    self.run_method("on_submit")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 755, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1024, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1007, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 749, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 415, in on_submit
    self.email_salary_slip()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 429, in email_salary_slip
    "attachments": [frappe.attach_print(self.doctype, self.name, file_name=self.name)],
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1272, in attach_print
    "fcontent": get_print(doctype, name, print_format=print_format, style=style, html=html, as_pdf=True, doc=doc, no_letterhead=no_letterhead)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1249, in get_print
    return get_pdf(html, output = output)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py", line 17, in get_pdf
    pdfkit.from_string(html, fname, options=options or {})
  File "/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/api.py", line 68, in from_string
    return r.to_pdf(output_path)
  File "/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py", line 140, in to_pdf
    raise IOError('wkhtmltopdf reported an error:\n' + stderr.decode('utf-8'))
IOError: wkhtmltopdf reported an error:
QSslSocket: cannot resolve CRYPTO_num_locks
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv3_server_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init
Exit with code 1 due to network error: UnknownNetworkError
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback

Seems there’s a known issue with wkhtml2pdf and https URLs on Debian

Fixed my wkhtml2pdf issue by doing this:

apt-get remove libssl-dev
apt-get install libssl1.0-dev

Back to the process just hanging

Here’s the live output of my worker.error.log

10:40:14 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.email.doctype.email_account.email_account.notify_unreplied', kwargs={}, method=u'frappe.email.doctype.email_account.email_account.notify_unreplied', site=u'xxxx.xxxxxx.com', user=u'Administrator') (db348629-6253-4148-85e3-a761fd183696)
10:40:15 short: Job OK (db348629-6253-4148-85e3-a761fd183696)
10:40:15 Result is kept for 500 seconds
10:40:15 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.oauth.delete_oauth2_data', kwargs={}, method=u'frappe.oauth.delete_oauth2_data', site=u'xxxx.xxxxxx.com', user=u'Administrator') (84535657-f1a8-456f-9daa-a4b4ca251c7c)
10:40:15 short: Job OK (84535657-f1a8-456f-9daa-a4b4ca251c7c)
10:40:15 Result is kept for 500 seconds
10:40:15 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, method=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', site=u'xxxx.xxxxxx.com', user=u'Administrator') (f3553f68-7de1-432b-9a35-b72df8aebee3)
10:40:15 short: Job OK (f3553f68-7de1-432b-9a35-b72df8aebee3)
10:40:15 Result is kept for 500 seconds
10:40:15 short: frappe.utils.background_jobs.execute_job(async=True, event=u'all', job_name=u'frappe.twofactor.delete_all_barcodes_for_users', kwargs={}, method=u'frappe.twofactor.delete_all_barcodes_for_users', site=u'xxxx.xxxxxx.com', user=u'Administrator') (af8c2037-0b66-4590-9dfc-5880919a67f1)
10:40:15 short: Job OK (af8c2037-0b66-4590-9dfc-5880919a67f1)
10:40:15 Result is kept for 500 seconds

I’m wondering about razorpay because of this line:

job_name=u'frappe.integrations.doctype.razorpay_settings.razorpay_settings.capture_payment', kwargs={}, 

I’m starting think this is a bug which is causing razorpay to be called when we haven’t enabled it. Only hunch and I’m speaking with little to no experience with ERPNext.

“When I attempt to submit a payslip it times out.”

ok so when Salary Slip submit hangs, you get an timeout message!? Please can you post it if so.

As well a traceback from some log (other than the worker.error.log) for this timeout and/or the razorpay call would be a help to identify the problem code.