Thanks for your suggestion smino!
The problem had to do with an unexpected command prompt header(??) piped to stdout (see my session below.)
A ‘git reset --hard’, to back out my changes to apps/erpnext and apps/frappe, got rid of the problem.
I checked for a malformed json file but nothing showed up:
(env) frappe@ubuntu:~/frappe-bench$ find . -name ‘*.json’ | xargs jsonlint
For the record I am on the staging branch:
(env) frappe@ubuntu:~/frappe-bench$ bench version
erpnext 11.0.3-beta.2
frappe 11.0.0-beta
Here’s is a snippet from my debug session:
(env) frappe@ubuntu:~/frappe-bench$ bench --help
/home/frappe/.bench/bench/utils.py(365)get_cmd_output()
→ output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devnull, ‘wb’)).strip()
(Pdb) l
360
361 def get_cmd_output(cmd, cwd=‘.’):
362 try:
363 import pdb
364 pdb.set_trace()
365 → output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devnull, ‘wb’)).strip()
366 output = output.decode(‘utf-8’)
367 return output
368 except subprocess.CalledProcessError as e:
369 if e.output:
370 print(e.output)
(Pdb) n
/home/frappe/.bench/bench/utils.py(366)get_cmd_output()
→ output = output.decode(‘utf-8’)
(Pdb) output
‘\x1b]0;IPython: frappe-bench/sites\x07[“restore”, “setup-help”, “set-admin-password”, “run-tests”, “migrate”, “reload-doctype”, “mysql”, “clear-limits”, “destroy-all-sessions”, “new-site”, “add-system-manager”, “publish-realtime”, “add-to-email-queue”, “clear-website-cache”, “set-maintenance-mode”, “run-setup-wizard-ui-test”, “worker”, “disable-scheduler”, “remove-from-installed-apps”, “set-config”, “drop-site”, “use”, “set-limits”, “console”, “doctor”, “run-ui-tests”, “schedule”, “disable-user”, “reset-perms”, “version”, “build”, “ready-for-migration”, “bulk-rename”, “export-doc”, “new-language”, “set-limit”, “uninstall-app”, “clear-cache”, “build-message-files”, “watch”, “run-patch”, “serve”, “import-csv”, “import-doc”, “trigger-scheduler-event”, “show-pending-jobs”, “scheduler”, “install-app”, “auto-deploy”, “build-docs”, “mariadb”, “make-app”, “reinstall”, “export-json”, “purge-jobs”, “list-apps”, “execute”, “import-translations”, “jupyter”, “enable-scheduler”, “setup-global-help”, “request”, “get-untranslated”, “update-translations”, “export-csv”, “rebuild-global-search”, “reload-doc”, “export-fixtures”, “backup”, “set-last-active-for-user”, “restore”, “setup-help”, “set-admin-password”, “run-tests”, “migrate”, “reload-doctype”, “mysql”, “clear-limits”, “destroy-all-sessions”, “new-site”, “add-system-manager”, “publish-realtime”, “add-to-email-queue”, “clear-website-cache”, “set-maintenance-mode”, “run-setup-wizard-ui-test”, “worker”, “disable-scheduler”, “remove-from-installed-apps”, “set-config”, “drop-site”, “use”, “set-limits”, “console”, “doctor”, “run-ui-tests”, “schedule”, “disable-user”, “reset-perms”, “version”, “build”, “ready-for-migration”, “bulk-rename”, “export-doc”, “new-language”, “set-limit”, “uninstall-app”, “clear-cache”, “build-message-files”, “watch”, “run-patch”, “serve”, “import-csv”, “import-doc”, “trigger-scheduler-event”, “show-pending-jobs”, “scheduler”, “install-app”, “auto-deploy”, “build-docs”, “mariadb”, “make-app”, “reinstall”, “export-json”, “purge-jobs”, “list-apps”, “execute”, “import-translations”, “jupyter”, “enable-scheduler”, “setup-global-help”, “request”, “get-untranslated”, “update-translations”, “export-csv”, “rebuild-global-search”, “reload-doc”, “export-fixtures”, “backup”, “set-last-active-for-user”, “make-demo”]’
(Pdb) l
361 def get_cmd_output(cmd, cwd=‘.’):
362 try:
363 import pdb
364 pdb.set_trace()
365 output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devnull, ‘wb’)).strip()
366 → output = output.decode(‘utf-8’)
367 return output
368 except subprocess.CalledProcessError as e:
369 if e.output:
370 print(e.output)
371 raise
(Pdb) cmd
‘/home/frappe/frappe-bench/env/bin/python -m frappe.utils.bench_helper get-frappe-commands’
(Pdb) output
‘\x1b]0;IPython: frappe-bench/sites\x07[“restore”, “setup-help”, “set-admin-password”, “run-tests”, “migrate”, “reload-doctype”, “mysql”, “clear-limits”, “destroy-all-sessions”, “new-site”, “add-system-manager”, “publish-realtime”, “add-to-email-queue”, “clear-website-cache”, “set-maintenance-mode”, “run-setup-wizard-ui-test”, “worker”, “disable-scheduler”, “remove-from-installed-apps”, “set-config”, “drop-site”, “use”, “set-limits”, “console”, “doctor”, “run-ui-tests”, “schedule”, “disable-user”, “reset-perms”, “version”, “build”, “ready-for-migration”, “bulk-rename”, “export-doc”, “new-language”, “set-limit”, “uninstall-app”, “clear-cache”, “build-message-files”, “watch”, “run-patch”, “serve”, “import-csv”, “import-doc”, “trigger-scheduler-event”, “show-pending-jobs”, “scheduler”, “install-app”, “auto-deploy”, “build-docs”, “mariadb”, “make-app”, “reinstall”, “export-json”, “purge-jobs”, “list-apps”, “execute”, “import-translations”, “jupyter”, “enable-scheduler”, “setup-global-help”, “request”, “get-untranslated”, “update-translations”, “export-csv”, “rebuild-global-search”, “reload-doc”, “export-fixtures”, “backup”, “set-last-active-for-user”, “restore”, “setup-help”, “set-admin-password”, “run-tests”, “migrate”, “reload-doctype”, “mysql”, “clear-limits”, “destroy-all-sessions”, “new-site”, “add-system-manager”, “publish-realtime”, “add-to-email-queue”, “clear-website-cache”, “set-maintenance-mode”, “run-setup-wizard-ui-test”, “worker”, “disable-scheduler”, “remove-from-installed-apps”, “set-config”, “drop-site”, “use”, “set-limits”, “console”, “doctor”, “run-ui-tests”, “schedule”, “disable-user”, “reset-perms”, “version”, “build”, “ready-for-migration”, “bulk-rename”, “export-doc”, “new-language”, “set-limit”, “uninstall-app”, “clear-cache”, “build-message-files”, “watch”, “run-patch”, “serve”, “import-csv”, “import-doc”, “trigger-scheduler-event”, “show-pending-jobs”, “scheduler”, “install-app”, “auto-deploy”, “build-docs”, “mariadb”, “make-app”, “reinstall”, “export-json”, “purge-jobs”, “list-apps”, “execute”, “import-translations”, “jupyter”, “enable-scheduler”, “setup-global-help”, “request”, “get-untranslated”, “update-translations”, “export-csv”, “rebuild-global-search”, “reload-doc”, “export-fixtures”, “backup”, “set-last-active-for-user”, “make-demo”]’
(Pdb) !output=‘[“restore”, “setup-help”, “set-admin-password”, “run-tests”, “migrate”, “request”, “mysql”, “clear-limits”, “new-site”, “add-system-manager”, “publish-realtime”, “add-to-email-queue”, “clear-website-cache”, “set-maintenance-mode”, “new-language”, “worker”, “disable-scheduler”, “remove-from-installed-apps”, “set-config”, “drop-site”, “use”, “mariadb”, “console”, “doctor”, “run-ui-tests”, “schedule”, “disable-user”, “reset-perms”, “version”, “build”, “ready-for-migration”, “bulk-rename”, “export-doc”, “run-setup-wizard-ui-test”, “set-limit”, “uninstall-app”, “clear-cache”, “build-message-files”, “serve”, “run-patch”, “watch”, “import-csv”, “list-apps”, “trigger-scheduler-event”, “show-pending-jobs”, “execute”, “scheduler”, “install-app”, “auto-deploy”, “build-docs”, “set-limits”, “make-app”, “reinstall”, “export-json”, “purge-jobs”, “import-doc”, “destroy-all-sessions”, “import-translations”, “jupyter”, “enable-scheduler”, “setup-global-help”, “reload-doctype”, “get-untranslated”, “update-translations”, “export-csv”, “rebuild-global-search”, “reload-doc”, “export-fixtures”, “backup”, “set-last-active-for-user”, “restore”, “setup-help”, “set-admin-password”, “run-tests”, “migrate”, “request”, “mysql”, “clear-limits”, “new-site”, “add-system-manager”, “publish-realtime”, “add-to-email-queue”, “clear-website-cache”, “set-maintenance-mode”, “new-language”, “worker”, “disable-scheduler”, “remove-from-installed-apps”, “set-config”, “drop-site”, “use”, “mariadb”, “console”, “doctor”, “run-ui-tests”, “schedule”, “disable-user”, “reset-perms”, “version”, “build”, “ready-for-migration”, “bulk-rename”, “export-doc”, “run-setup-wizard-ui-test”, “set-limit”, “uninstall-app”, “clear-cache”, “build-message-files”, “serve”, “run-patch”, “watch”, “import-csv”, “list-apps”, “trigger-scheduler-event”, “show-pending-jobs”, “execute”, “scheduler”, “install-app”, “auto-deploy”, “build-docs”, “set-limits”, “make-app”, “reinstall”, “export-json”, “purge-jobs”, “import-doc”, “destroy-all-sessions”, “import-translations”, “jupyter”, “enable-scheduler”, “setup-global-help”, “reload-doctype”, “get-untranslated”, “update-translations”, “export-csv”, “rebuild-global-search”, “reload-doc”, “export-fixtures”, “backup”, “set-last-active-for-user”, “make-demo”]’
(Pdb) output
‘[“restore”, “setup-help”, “set-admin-password”, “run-tests”, “migrate”, “request”, “mysql”, “clear-limits”, “new-site”, “add-system-manager”, “publish-realtime”, “add-to-email-queue”, “clear-website-cache”, “set-maintenance-mode”, “new-language”, “worker”, “disable-scheduler”, “remove-from-installed-apps”, “set-config”, “drop-site”, “use”, “mariadb”, “console”, “doctor”, “run-ui-tests”, “schedule”, “disable-user”, “reset-perms”, “version”, “build”, “ready-for-migration”, “bulk-rename”, “export-doc”, “run-setup-wizard-ui-test”, “set-limit”, “uninstall-app”, “clear-cache”, “build-message-files”, “serve”, “run-patch”, “watch”, “import-csv”, “list-apps”, “trigger-scheduler-event”, “show-pending-jobs”, “execute”, “scheduler”, “install-app”, “auto-deploy”, “build-docs”, “set-limits”, “make-app”, “reinstall”, “export-json”, “purge-jobs”, “import-doc”, “destroy-all-sessions”, “import-translations”, “jupyter”, “enable-scheduler”, “setup-global-help”, “reload-doctype”, “get-untranslated”, “update-translations”, “export-csv”, “rebuild-global-search”, “reload-doc”, “export-fixtures”, “backup”, “set-last-active-for-user”, “restore”, “setup-help”, “set-admin-password”, “run-tests”, “migrate”, “request”, “mysql”, “clear-limits”, “new-site”, “add-system-manager”, “publish-realtime”, “add-to-email-queue”, “clear-website-cache”, “set-maintenance-mode”, “new-language”, “worker”, “disable-scheduler”, “remove-from-installed-apps”, “set-config”, “drop-site”, “use”, “mariadb”, “console”, “doctor”, “run-ui-tests”, “schedule”, “disable-user”, “reset-perms”, “version”, “build”, “ready-for-migration”, “bulk-rename”, “export-doc”, “run-setup-wizard-ui-test”, “set-limit”, “uninstall-app”, “clear-cache”, “build-message-files”, “serve”, “run-patch”, “watch”, “import-csv”, “list-apps”, “trigger-scheduler-event”, “show-pending-jobs”, “execute”, “scheduler”, “install-app”, “auto-deploy”, “build-docs”, “set-limits”, “make-app”, “reinstall”, “export-json”, “purge-jobs”, “import-doc”, “destroy-all-sessions”, “import-translations”, “jupyter”, “enable-scheduler”, “setup-global-help”, “reload-doctype”, “get-untranslated”, “update-translations”, “export-csv”, “rebuild-global-search”, “reload-doc”, “export-fixtures”, “backup”, “set-last-active-for-user”, “make-demo”]’
(Pdb) c
Usage: [OPTIONS] COMMAND [ARGS]…
Bench manager for Frappe
Options:
–version
–help Show this message and exit.
Commands:
backup backup site
backup-all-sites backup all sites
config change bench configuration
disable-production Disables production environment for the…
download-translations Download latest translations
exclude-app Exclude app from updating
get-app clone an app from the internet and set it up…
include-app Include app from updating
init Create a New Bench Instance.
install Install system dependancies
migrate-env Migrate Virtual Environment to desired Python…
new-app start a new app
prepare-beta-release Prepare major beta release from develop…
release Release app (internal to the Frappe team)
remote-reset-url Reset app remote url to frappe official
remote-set-url Set app remote url
remote-urls Show apps remote url
remove-app completely remove app from bench
renew-lets-encrypt Renew Let’s Encrypt certificate
restart Restart supervisor processes or systemd units
retry-upgrade
set-default-site Set default site for bench
set-mariadb-host Set MariaDB host for bench
set-nginx-port Set nginx port for site
set-ssl-certificate Set ssl certificate path for site
set-ssl-key Set ssl certificate private key path for site
set-url-root Set url root for site
setup Setup bench
shell
src Prints bench source folder path, which can be…
start Start Frappe development processes
switch-to-branch Switch all apps to specified branch, or…
switch-to-develop Switch frappe and erpnext to develop branch
switch-to-master Switch frappe and erpnext to master branch
update Update bench
()
Notice in the above session that removing the command prompt
\x1b]0;IPython: frappe-bench/sites\x07
and the ‘bench --help’ script runs as expected…