V9 POS Error at launch

Getting a POST http://erp.xxxxxx.com/ 500 (INTERNAL SERVER ERROR) when launching POS since v9.0.2 update / Frappe famework 9.0.4:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 57, 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 923, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.py”, line 24, in get_items
lft, rgt = frappe.db.get_value(‘Item Group’, item_group, [‘lft’, ‘rgt’])
TypeError: ‘NoneType’ object is not iterable

And:

Uncaught (in promise) TypeError: Cannot read property ‘getBoundingClientRect’ of null
at m._setMeasurements (libs.min.js?ver=1506516648.0:24)
at new m (libs.min.js?ver=1506516648.0:24)
at Class.init (list.min.js?ver=1506516648.0:1163)
at new Class (desk.min.js?ver=1506516648.0:41)
at Class.make_tags (form.min.js?ver=1506516648.0:4616)
at Class.make (form.min.js?ver=1506516648.0:4560)
at _f.Frm.render_form (form.min.js?ver=1506516648.0:543)
at form.min.js?ver=1506516648.0:635
at

Then:

Uncaught (in promise) TypeError: Cannot read property ‘getBoundingClientRect’ of null
at m._setMeasurements (libs.min.js?ver=1506516648.0:24)
at new m (libs.min.js?ver=1506516648.0:24)
at Class.init (list.min.js?ver=1506516648.0:1163)
at new Class (desk.min.js?ver=1506516648.0:41)
at Class.make_tags (form.min.js?ver=1506516648.0:4616)
at Class.make (form.min.js?ver=1506516648.0:4560)
at _f.Frm.render_form (form.min.js?ver=1506516648.0:543)
at form.min.js?ver=1506516648.0:635
at

System fail to load default customer for POS profile and won’t load Articles. Article search also fails:
Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 57, 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 923, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.py”, line 24, in get_items
lft, rgt = frappe.db.get_value(‘Item Group’, item_group, [‘lft’, ‘rgt’])
TypeError: ‘NoneType’ object is not iterable

Unable to use POS.

Hi @bardbq

Thanks for reporting an issue, we have identified and fixed the issue. Soon we’ll release the fix of an issue

1 Like

You guys are very efficient! Thanks!

G.

1 Like

Hi @bardbq

We have released the fix of an issue, kindly pull latest update and check

Unable to update (never had an error while updating before):

frappe@ip-xxx-xx-xx-xx:~/frappe-bench$ bench update --reset
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
INFO:bench.utils:git fetch --all
Fetching upstream
INFO:bench.utils:git reset --hard upstream/master
HEAD is now at e41e857 Merge branch ‘hotfix’
INFO:bench.utils:find . -name “*.pyc” -delete
INFO:bench.app:pulling erpnext
INFO:bench.utils:git fetch --all
Fetching upstream
remote: Counting objects: 43, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 43 (delta 36), reused 33 (delta 26), pack-reused 0
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed
error: Could not fetch upstream
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/update.py”, line 58, in update
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, force=force, reset=reset)
File “/home/frappe/.bench/bench/commands/update.py”, line 71, in _update
pull_all_apps(bench_path=bench_path, reset=reset)
File “/home/frappe/.bench/bench/app.py”, line 165, in pull_all_apps
exec_cmd(“git fetch --all”, cwd=app_dir)
File “/home/frappe/.bench/bench/utils.py”, line 140, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git fetch --all

Could this be because I said: “y” - yes twice when updating to v9?

On this question:

Your bench was upgraded to version 9
supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]:

I said “y” and later read on the forum I should have said “no”… Could this be the problem? If yes can I revert this?

Thanks,

G.

Seems permission error, can you try with command bench update and check

bench update always gave me an error (i did no change to either frappe or erpnext), this time this is the error I get:

frappe@ip-xxx-xx-xx-xx:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 9 (delta 7), reused 9 (delta 7), pack-reused 0
Unpacking objects: 100% (9/9), done.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
9c63471…5882fbd develop → upstream/develop
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)

Cannot proceed with update: You have local changes in app “frappe” that are not committed.

Here are your choices:

  1. Merge the frappe app manually with “git pull” / “git pull --rebase” and fix conflicts.
  2. Temporarily remove your changes with “git stash” or discard them completely
    with “bench update --reset” or for individual repositries “git reset --hard”
  3. If your changes are helpful for others, send in a pull request via GitHub and
    wait for them to be merged in the core.

That’s why I always use bench update --reset which gave me the previous error message.

Could the update from v8 to v9 change some file ownership?

You did local changes and therefore it’s not allowing to update, what changes did you made? Kindly commit or stash the changes and then do the bench update again

Nope

I didn’t do any changes:

frappe@ip-xxx-xx-xx-xx:~/frappe-bench/apps/erpnext$ git stash
No local changes to save
frappe@ip-xxx-xx-xx-xx:~/frappe-bench/apps/erpnext$ cd …
frappe@ip-xxx-xx-xx-xx:~/frappe-bench/apps$ cd frappe
frappe@ip-xxx-xx-xx-xx:~/frappe-bench/apps/frappe$ git stash
No local changes to save
frappe@ip-xxx-xx-xx-xx:~/frappe-bench/apps/frappe$

I was able to fix the issue, logged as root user:

ubuntu@ip-xxx-xx-xx-xx:~$ cd /home/frappe/frappe-bench/apps/erpnext
ubuntu@ip-xxx-xx-xx-xx:/home/frappe/frappe-bench/apps/erpnext$ sudo chown -R frappe:frappe “$(git rev-parse --show-toplevel)/.git”
ubuntu@ip-xxx-xx-xx-xx:/home/frappe/frappe-bench/apps/erpnext$ cd /home/frappe/frappe-bench/apps/frappe
ubuntu@ip-xxx-xx-xx-xx:/home/frappe/frappe-bench/apps/frappe$ sudo chown -R frappe:frappe “$(git rev-parse --show-toplevel)/.git”
ubuntu@ip-xxx-xx-xx-xx:/home/frappe/frappe-bench/apps/frappe$ cd /home/frappe/frappe-bench
ubuntu@ip-xxx-xx-xx-xx:/home/frappe/frappe-bench$ su frappe
Password: xxxxxxx
frappe@ip-xxx-xx-xx-xx:~/frappe-bench$ bench update --reset


the sudo chown -R frappe:frappe “$(git rev-parse --show-toplevel)/.git” command performed in erpnext and frappe git repository has fixed the permission issue (still no idea why I had this permission problem after updating) and I was then able to update. Still impossible to perform any update without “–reset” while I made no change to erpnext and frappe…

I’m now on:
ERPNext: v9.0.4 (master)
Frappe Framework: v9.0.7 (master)

After all this, I can confirm that the POS error is now solved!

Thank you guys! Have a great weekend!

G.

Seems like default client that is set in POS profile is not automatically polled on POS load. Also, it seems like any discount I set on a single item (once added to cart) is also added to the other items in the cart.

libs.min.js?ver=1506687167.0:sourcemap:24 Uncaught (in promise) TypeError: Cannot read property ‘getBoundingClientRect’ of null
at m._setMeasurements (libs.min.js?ver=1506687167.0:sourcemap:24)
at new m (libs.min.js?ver=1506687167.0:sourcemap:24)
at Class.init (list.min.js?ver=1506687167.0:1177)
at new Class (desk.min.js?ver=1506687167.0:41)
at Class.make_tags (form.min.js?ver=1506687167.0:4616)
at Class.make (form.min.js?ver=1506687167.0:4560)
at _f.Frm.render_form (form.min.js?ver=1506687167.0:543)
at form.min.js?ver=1506687167.0:635
at

Thanks for reporting an issue, we have fixed it and soon we’ll release it

This issue is not replicating, seems you have active pricing rule for discount