Various errors since update. Possibly connected?

Since we last updated a week or so ago, the following errors have started happening. I believe they are related, can anyone offer any insight?

By the way, we are running ERPNext 7.0.18 and Frappe 7.0.15 on a VM running Ubuntu 14.04

No Autostart

The system doesn’t autostart when starting the server. We have to manually start it using:

cd frappe-bench
sudo bench start

Note that we have to use sudo bench start. bench start doesn’t work.

Also, there is a Frappe user account that was created during installation, but we have no passwords for it. Is the password for the Frappe account stored somewhere when it was created?

DropBox Backups (SOLVED)

Backups are not being generated or sent to dropbox. We receive the following error:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 879, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_backup/dropbox_backup.py", line 80, in get_dropbox_authorize_url
    request_token = sess.obtain_request_token()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/session.py", line 216, in obtain_request_token
    response = self.rest_client.POST(url, headers=headers, params=params, raw_response=True)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py", line 322, in POST
    return cls.IMPL.POST(*n, **kw)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py", line 260, in POST
    is_json_request=is_json_request)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py", line 235, in request
    raise ErrorResponse(r, r.read())
ErrorResponse: [401] u'Unauthorized'

I understand that this error usually related to the keys being set wrong, but we checked and doublechecked, and as far as I can tell they are correct.

No Email

###No Email
Dedicated Thread
https://discuss.frappe.io/t/error-sending-email/14946

We receive the following error when attempting to send emails

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 879, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 32, in send_now
    send_one(doc, now=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 290, in send_one
    from `tabEmail Queue` where name=%s for update''', email, as_dict=True)[0]
IndexError: list index out of range

[details=No PDF] (SOLVED)

We receive the following error when attempting to generate PDFs

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 58, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 49, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 879, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/print_format.py", line 50, in download_pdf
    frappe.local.response.filecontent = get_pdf(html)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py", line 16, 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 143, in to_pdf
    raise IOError("wkhtmltopdf exited with non-zero code {0}. error:\n{1}".format(exit_code, stderr.decode("utf-8")))
IOError: wkhtmltopdf exited with non-zero code -6. error:
The switch --no-outline, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.The switch --print-media-type, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display 

[/details]

@vjFaLk can you check?

Is this your own VM, or the VM you downloaded from the erpnext website?

Okay, this issue, we’re aware of. Just turn off bench start and run sudo service supervisorctl start that will basically start supervisor, which is what manages ERPNext’s services, it doesn’t auto-start at boot time. You shouldn’t need to run sudo bench start

If you’re root you can just login to frappe by doing su frappe. You can set a password for frappe as root by just runnning passwd frappe

Hmm seems to be a problem on the Dropbox side, maybe there’s something you need to set to authorize ERPNext?

I guess wkhtmltopdf wasn’t installed correctly? That’s odd because I have not had this issue with the installer recently. Could you reinstall it?

We will try these and get back to you shortly. It is our VM, not ERPNext’s.

Dropbox is fixed. Typographical error.

@vjFaLk Thanks for your help, Any suggestions for the email? @makarand_b said we need to look in our email queue table in our database, But I’m not sure how to do that or what I’d be looking for.

Seems like a bug? Just updating should probably fix it.

Also run bench doctor in frappe-bench and give me the output?

Our output from bench doctor:



----Checking scheduler status-----

Workers Online: 3

------------None Jobs-----------------

Attempting update resulted in error
08-22-2016 Bench Update Failure
(Click the image for a bigger version)

Looks like the same error as:

Performing:

git reset --hard
git pull

in the apps/ERPnext folder Did not fix the issue

@cpurbaugh Looks like there are local changes in the bench-repo folder rather than frappe-bench/apps/… - do the same reset commands there and give the update another shot.

Ok, it updated fine. For anyone else with this problem:

Now when attempting to send email there’s no error, but the email doesn’t send, and the status doesn’t update.

Have you checked your bench doctor at the latest point?

No, I haven’t. I’ll run it and get back to you.

New bench doctor error:



ule_as_main

   "__main__", fname, loader, pkg_name)

 File "/usr/lib/python2.7/runpy.py", line 72, in _run_code

   exec code in run_globals

 File
"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py",
line 79, in <module>

   main()

 File
"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py",
line 16, in main

   click.Group(commands=commands)(prog_name='bench')

 File
"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py",
line 716, in __call__

   return self.main(*args, **kwargs)

 File
"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py",
line 696, in main

   rv = self.invoke(ctx)

 File
"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py",
line 1060, in invoke

   return _process_result(sub_ctx.command.invoke(sub_ctx))

 File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py",
line 1060, in invoke

   return _process_result(sub_ctx.command.invoke(sub_ctx))

 File
"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py",
line 889, in invoke

   return ctx.invoke(self.callback, **ctx.params)

 File
"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py",
line 534, in invoke

   return callback(*args, **kwargs)

 File
"/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py",
line 121, in doctor

   return _doctor(site=site)

 File
"/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line
97, in doctor

   workers_online = check_number_of_workers()

 File
"/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line
85, in check_number_of_workers

   return len(get_workers())

 File
"/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line
11, in get_workers

   workers = Worker.all()

 File
"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/work

Receiving a new error for the email:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 879, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 242, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 286, in _save
    self.run_post_save_methods()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 728, in run_post_save_methods
    self.run_method("on_update")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 661, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 839, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 822, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 655, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 71, in on_update
    self.send_password_notification(self.__new_password)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 161, in send_password_notification
    self.email_new_password(new_password)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 123, in email_new_password
    self.password_update_mail(new_password)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 206, in password_update_mail
    "templates/emails/password_update.html", {"new_password": password}, now=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 241, in send_login_mail
    delayed=(not now) if now!=None else self.flags.delay_emails)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 403, in sendmail
    cc=cc, message_id=message_id, in_reply_to=in_reply_to)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/__init__.py", line 25, in sendmail
    send(mail)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py", line 29, in send
    smtpserver.sess.sendmail(email.sender, email.recipients + (email.cc or []), email_body)
  File "/usr/lib/python2.7/smtplib.py", line 750, in sendmail
    self.rset()
  File "/usr/lib/python2.7/smtplib.py", line 469, in rset
    return self.docmd("rset")
  File "/usr/lib/python2.7/smtplib.py", line 394, in docmd
    return self.getreply()
  File "/usr/lib/python2.7/smtplib.py", line 368, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
SMTPServerDisconnected: Connection unexpectedly closed

Now I’m back to not receiving an error message when I try to send an email, but they don’t send.

Closing this for now. Continuing the conversation at: