First time login causes server side exception and hangs the login process

165 views
Skip to first unread message

Anirban Majumdar

unread,
Mar 3, 2014, 6:05:08 AM3/3/14
to erpnext-dev...@googlegroups.com
Hello,

I just managed to deploy the ERPNext application on an ec2 server. Everything seemed to work fine, until the point where I tried to login with my newly created user ID. The server error log shows the occurrence of an exception: 

Traceback (most recent call last):
  File "/home/erpnext/erpnext/erpnext/lib/webnotes/middlewares.py", line 12, in __call__
    return super(StaticDataMiddleware, self).__call__(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 579, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 224, in application
    return ClosingIterator(app(environ, start_response), self.cleanup)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 285, in application
    return f(*args[:-2] + (request,))(*args[-2:])
  File "/home/erpnext/erpnext/erpnext/lib/webnotes/app.py", line 50, in application
    webnotes.http_request = webnotes.auth.HTTPRequest()
  File "/home/erpnext/erpnext/erpnext/lib/webnotes/auth.py", line 51, in __init__
    webnotes.local.login_manager.run_trigger('on_login_post_session')
  File "/home/erpnext/erpnext/erpnext/lib/webnotes/auth.py", line 155, in run_trigger
    getattr(event_handlers, method)(self)
  File "/home/erpnext/erpnext/erpnext/app/startup/event_handlers.py", line 35, in on_login_post_session
    set_cart_count()
  File "/home/erpnext/erpnext/erpnext/app/selling/utils/cart.py", line 14, in set_cart_count
    quotation = _get_cart_quotation()
  File "/home/erpnext/erpnext/erpnext/app/selling/utils/cart.py", line 241, in _get_cart_quotation
    qbean.run_method("onload_post_render")
  File "/home/erpnext/erpnext/erpnext/lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "/home/erpnext/erpnext/erpnext/app/controllers/selling_controller.py", line 16, in onload_post_render
    self.set_missing_values()
  File "/home/erpnext/erpnext/erpnext/app/controllers/selling_controller.py", line 27, in set_missing_values
    super(SellingController, self).set_missing_values(for_validate)
  File "/home/erpnext/erpnext/erpnext/app/controllers/accounts_controller.py", line 30, in set_missing_values
    self.doc.fiscal_year = get_fiscal_year(self.doc.fields[fieldname])[0]
  File "/home/erpnext/erpnext/erpnext/app/accounts/utils.py", line 19, in get_fiscal_year
    return get_fiscal_years(date, fiscal_year, label, verbose)[0]
  File "/home/erpnext/erpnext/erpnext/app/accounts/utils.py", line 33, in get_fiscal_years
    error_msg = """%s %s not in any Fiscal Year""" % (label, formatdate(date))
  File "/home/erpnext/erpnext/erpnext/lib/webnotes/utils/__init__.py", line 274, in formatdate

I checked the __init__.py file and it expects a date format string to be available as part of user_format data struct. But i think that gets created from the settings panel of the user. How can I handle this right at the point of first login?

Thanks,
Anirban

Anand Doshi

unread,
Mar 3, 2014, 6:49:31 AM3/3/14
to Anirban Majumdar, erpnext-dev...@googlegroups.com
Hi Anirban,

Try settings the correct default fiscal year in Setup > Global Settings.

Best,
Anand Doshi.
--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/254cb329-8b5a-498e-b118-9a0fefdcd51c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Anirban Majumdar

unread,
Mar 3, 2014, 7:20:03 AM3/3/14
to erpnext-dev...@googlegroups.com, Anirban Majumdar
Forgot to mark a copy to the forum—

Hello Anand,

At this point, I'm not even able to login to the platform. This is the very first login attempt after installing ERPNext. Is there some other way to access the Settings -> Global Defaults without having to login?

Thanks,
Anirban
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Anand Doshi

unread,
Mar 3, 2014, 7:49:26 AM3/3/14
to Anirban Majumdar, erpnext-dev...@googlegroups.com, Anirban Majumdar
Hi Anirban,

You can use Administrator user to login. The default password is admin.

Best,
Anand Doshi.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/6bb748a0-d592-4235-98f7-1a5776450608%40googlegroups.com.

Anirban Majumdar

unread,
Mar 3, 2014, 9:17:10 AM3/3/14
to Anand Doshi, erpnext-dev...@googlegroups.com
Ahh, thank you so very much :)

Don't know why, but I was fixated with the whole creating a "New User" and then trying to start-off with that.

Would it probably help if say, ERPNext would prompt the user with a "Setup Using Admin" alert message as long as the platform knows that the initial setup using an Admin account hasn't been done?

Thanks again for the prompt help!

Anand Doshi

unread,
Mar 4, 2014, 10:39:33 AM3/4/14
to Anirban Majumdar, erpnext-dev...@googlegroups.com
Hi Anirban,

It does that in the new version. Which version are you using?
When you login the first time and use the setup wizard, it asks you for a username and password to be created.

Best,
Anand Doshi.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/254cb329-8b5a-498e-b118-9a0fefdcd51c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

Anirban Majumdar

unread,
Mar 4, 2014, 10:42:48 AM3/4/14
to Anand Doshi, erpnext-dev...@googlegroups.com
Hey Anand,

The version I'm using is — 3.9.6

And after installing the code base on my server and running ./lib/wnf.py --serve, the screen I got was this—

Inline image 1


Reply all
Reply to author
Forward
0 new messages