Procfile missing, Jinja2 Template not found macOS Sierra

Hey everyone.

I come here very frustrated.

It took a very long time to get ERPNext working, and now, basically out of the blue it just stopped working.

After hours (days) reading the forum, tried everything, and decided to do a clean install, so I deleted every file and folder I could find that was related to frappé/bench.

After the install, I got the following errors:

$ bench init frappe-bench
INFO:bench.utils:virtualenv -q env -p /usr/local/opt/python/bin/python2.7
Already using interpreter /usr/local/opt/python/bin/python2.7
INFO:bench.utils:./env/bin/pip -q install --upgrade pip
INFO:bench.utils:./env/bin/pip -q install wheel
INFO:bench.utils:./env/bin/pip -q install six
INFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --origin upstream
Cloning into ‘frappe’…
remote: Counting objects: 145430, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 145430 (delta 0), reused 1 (delta 0), pack-reused 145426
Receiving objects: 100% (145430/145430), 119.49 MiB | 4.37 MiB/s, done.
Resolving deltas: 100% (110774/110774), done.
(‘installing’, u’frappe’)
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe --no-cache-dir
Updating node libraries…
INFO:bench.utils:npm install

fsevents@1.1.3 install /Users/Carvalho/frappe-bench/node_modules/fsevents
node install

[fsevents] Success: “/Users/Carvalho/frappe-bench/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node” already installed
Pass --update-binary to reinstall or --build-from-source to recompile

uws@0.14.5 install /Users/Carvalho/frappe-bench/node_modules/uws
node-gyp rebuild > build_log.txt 2>&1 || exit 0

chromedriver@2.33.2 install /Users/Carvalho/frappe-bench/node_modules/chromedriver
node install.js

Downloading https://chromedriver.storage.googleapis.com/2.33/chromedriver_mac64.zip
Saving to /var/folders/5m/hjzx82j152n9bnnrn91dlt3h0000gn/T/chromedriver/chromedriver_mac64.zip
Received 782K…
Received 1568K…
Received 2352K…
Received 3136K…
Received 3920K…
Received 4704K…
Received 5299K total.
Extracting zip contents
Copying to target path /Users/Carvalho/frappe-bench/node_modules/chromedriver/lib/chromedriver
Fixing file permissions
Done. ChromeDriver binary available at /Users/Carvalho/frappe-bench/node_modules/chromedriver/lib/chromedriver/chromedriver
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN frappe@ No description

added 572 packages in 96.216s
Wrote css/frappe-web.css - 65.11 KB
Wrote js/frappe-web.min.js - 132.05 KB
Wrote js/control.min.js - 72.03 KB
Wrote js/dialog.min.js - 116.12 KB
Wrote css/desk.min.css - 309.31 KB
Wrote css/frappe-rtl.css - 32.49 KB
Wrote js/libs.min.js - 1.13 MB
Wrote js/desk.min.js - 459.48 KB
Wrote css/module.min.css - 2.08 KB
Wrote css/form.min.css - 4.47 KB
Wrote js/form.min.js - 195.68 KB
Wrote css/list.min.css - 15.04 KB
Wrote js/list.min.js - 149.73 KB
Wrote css/report.min.css - 7.89 KB
Wrote js/report.min.js - 260.01 KB
Wrote js/web_form.min.js - 247.55 KB
Wrote css/web_form.css - 24.42 KB
Wrote js/print_format_v3.min.js - 23.39 KB
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench==4.1.0’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python2.7/site-packages/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/bench/commands/make.py”, line 21, in init
verbose=verbose, clone_from=clone_from, skip_bench_mkdir=skip_bench_mkdir, skip_redis_config_generation=skip_redis_config_generation)
File “/usr/local/lib/python2.7/site-packages/bench/utils.py”, line 81, in init
setup_procfile(path)
File “/usr/local/lib/python2.7/site-packages/bench/config/procfile.py”, line 13, in setup_procfile
procfile = bench.env.get_template(‘Procfile’).render(
File “/usr/local/lib/python2.7/site-packages/jinja2/environment.py”, line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File “/usr/local/lib/python2.7/site-packages/jinja2/environment.py”, line 804, in _load_template
template = self.loader.load(self, name, globals)
File “/usr/local/lib/python2.7/site-packages/jinja2/loaders.py”, line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File “/usr/local/lib/python2.7/site-packages/jinja2/loaders.py”, line 235, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: Procfile

And when trying to start the bench to create my sites:

$ bench start
[8013] [ERROR] Procfile does not exist or is not a file

I tried downloading the procfile from the GitHub repo, tried reinstalling jinja, node.
Tried reinstalling python. Deleted every possible connection from my old folder…

(Yes, I am running it from my frappe-bench folder.)
I really don’t understand what am I doing wrong.

Can anybody shed some light on this issue?

Cheers

Try command: bench setup procfile from your frappe-bench directory

Thanks Pawan,

Tried that a couple of time with my old installation as well without success, my last traceback:

$ bench setup procfile
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench==4.1.0’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python2.7/site-packages/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/bench/commands/setup.py”, line 123, in setup_procfile
setup_procfile(‘.’)
File “/usr/local/lib/python2.7/site-packages/bench/config/procfile.py”, line 13, in setup_procfile
procfile = bench.env.get_template(‘Procfile’).render(
File “/usr/local/lib/python2.7/site-packages/jinja2/environment.py”, line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File “/usr/local/lib/python2.7/site-packages/jinja2/environment.py”, line 804, in _load_template
template = self.loader.load(self, name, globals)
File “/usr/local/lib/python2.7/site-packages/jinja2/loaders.py”, line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File “/usr/local/lib/python2.7/site-packages/jinja2/loaders.py”, line 235, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: Procfile

The only thing strange I can notice is Python.
When I type python --version I get 2.7.10.
But when I brew unlink python && brew link python the links are regarding version 2.7.14.

Would it make sense to delete everything and try to setup a virtualenv just for frappe/bench?

Another information, even though I deleted Users/frappe with sudo rm -rf, it still appears in locate frappe (even after updatedb) and in my start-up screen - maybe there’s some residual files from my previous installations, but I can’t seem to fix it.

Hello,

Any others ideas on how to get this fixed?
Tried deleting everything and installing again and I’m getting the same error…

Thanks

Apparently you brew on a mac…

In which case this talks about config hell [SOLVED] Install ERPNext on OS X (w/o VM)

Yep… that was also me.
After a while, things have stopped working don’t know exactly why, and now I just can’t seem to make it work again…

Perhaps just run on a VM - that would free you from such environment woes?

It would.
The thing is, I work with a 2010 Macbook Pro and have to run Parallels (Excel work) pretty much all the time, so two VM’s makes my computer want to die.
But it feels like it’s the only option for now…

For now, try creating a Procfile within your frappe-bench folder. Here’s the template for the same. Continue with a bench start and let me know whether it helps.

I opened an issue for the same.

Hey, thanks a lot for your response.

Just to make sure, Procfile has no extension, right?

Tried that and now got an strange error that I haven’t seen before:

02:51:22 system           | redis_socketio.1 started (pid=50193)
02:51:22 system           | worker_long.1 started (pid=50194)
02:51:22 system           | watch.1 started (pid=50197)
02:51:22 system           | redis_queue.1 started (pid=50198)
02:51:22 system           | web.1 started (pid=50200)
02:51:22 system           | schedule.1 started (pid=50202)
02:51:22 system           | worker_default.1 started (pid=50205)
02:51:22 system           | async_worker.1 started (pid=50208)
02:51:22 system           | socketio.1 started (pid=50210)
02:51:22 socketio.1       | /bin/sh: {{: command not found
02:51:22 system           | socketio.1 stopped (rc=127)
02:51:22 system           | redis_cache.1 started (pid=50211)
02:51:22 system           | worker.1 started (pid=50214)
02:51:22 system           | worker_short.1 started (pid=50215)
02:51:22 system           | longjob_worker.1 started (pid=50217)
02:51:22 system           | workerbeat.1 started (pid=50219)
02:51:22 system           | sending SIGTERM to redis_socketio.1 (pid 50193)
02:51:22 system           | sending SIGTERM to worker_long.1 (pid 50194)
02:51:22 system           | sending SIGTERM to watch.1 (pid 50197)
02:51:22 system           | sending SIGTERM to redis_queue.1 (pid 50198)
02:51:22 system           | sending SIGTERM to web.1 (pid 50200)
02:51:22 system           | sending SIGTERM to schedule.1 (pid 50202)
02:51:22 system           | sending SIGTERM to worker_default.1 (pid 50205)
02:51:22 system           | sending SIGTERM to async_worker.1 (pid 50208)
02:51:22 system           | sending SIGTERM to redis_cache.1 (pid 50211)
02:51:22 system           | sending SIGTERM to worker.1 (pid 50214)
02:51:22 system           | sending SIGTERM to worker_short.1 (pid 50215)
02:51:22 system           | sending SIGTERM to longjob_worker.1 (pid 50217)
02:51:22 system           | sending SIGTERM to workerbeat.1 (pid 50219)
02:51:22 system           | worker_default.1 stopped (rc=-15)
02:51:22 system           | workerbeat.1 stopped (rc=-15)
02:51:22 system           | longjob_worker.1 stopped (rc=-15)
02:51:22 system           | watch.1 stopped (rc=-15)
02:51:22 system           | web.1 stopped (rc=-15)
02:51:22 system           | worker_long.1 stopped (rc=-15)
02:51:22 system           | schedule.1 stopped (rc=-15)
02:51:22 system           | worker_short.1 stopped (rc=-15)
02:51:22 system           | async_worker.1 stopped (rc=-15)
02:51:22 system           | worker.1 stopped (rc=-15)
02:51:22 system           | redis_socketio.1 stopped (rc=-9)
02:51:22 system           | redis_cache.1 stopped (rc=-9)
02:51:22 system           | redis_queue.1 stopped (rc=-9)

Edit:

I’ve noticed that SocketIO has something to do with Redis, so I tried pip install redis again (even though I had done that before) and now the error changed a bit:

02:55:13 system           | redis_socketio.1 started (pid=51534)
02:55:13 system           | worker_long.1 started (pid=51536)
02:55:13 system           | watch.1 started (pid=51537)
02:55:13 system           | redis_queue.1 started (pid=51539)
02:55:13 redis_queue.1    | 51539:C 04 Jan 02:55:12.996 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
02:55:13 redis_queue.1    | 51539:C 04 Jan 02:55:13.005 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=51539, just started
02:55:13 redis_queue.1    | 51539:C 04 Jan 02:55:13.005 # Configuration loaded
02:55:13 redis_queue.1    | 51539:M 04 Jan 02:55:13.007 * Increased maximum number of open files to 10032 (it was originally set to 256).
02:55:13 redis_queue.1    | 51539:M 04 Jan 02:55:13.010 * Running mode=standalone, port=11000.
02:55:13 redis_queue.1    | 51539:M 04 Jan 02:55:13.010 # Server initialized
02:55:13 redis_queue.1    | 51539:M 04 Jan 02:55:13.010 * Ready to accept connections
02:55:13 system           | web.1 started (pid=51541)
02:55:13 system           | schedule.1 started (pid=51543)
02:55:13 system           | worker_default.1 started (pid=51545)
02:55:13 system           | async_worker.1 started (pid=51548)
02:55:13 system           | socketio.1 started (pid=51550)
02:55:13 socketio.1       | /bin/sh: {{: command not found
02:55:13 system           | socketio.1 stopped (rc=127)
02:55:13 system           | redis_cache.1 started (pid=51551)
02:55:13 redis_cache.1    | 51551:C 04 Jan 02:55:13.169 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
02:55:13 redis_cache.1    | 51551:C 04 Jan 02:55:13.170 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=51551, just started
02:55:13 redis_cache.1    | 51551:C 04 Jan 02:55:13.170 # Configuration loaded
02:55:13 redis_cache.1    | 51551:M 04 Jan 02:55:13.172 * Increased maximum number of open files to 10032 (it was originally set to 256).
02:55:13 redis_cache.1    | 51551:M 04 Jan 02:55:13.174 * Running mode=standalone, port=13000.
02:55:13 redis_cache.1    | 51551:M 04 Jan 02:55:13.174 # Server initialized
02:55:13 redis_cache.1    | 51551:M 04 Jan 02:55:13.174 * Ready to accept connections
02:55:13 system           | worker.1 started (pid=51553)
02:55:13 system           | worker_short.1 started (pid=51556)
02:55:13 system           | longjob_worker.1 started (pid=51557)
02:55:13 system           | workerbeat.1 started (pid=51559)
02:55:13 system           | sending SIGTERM to redis_socketio.1 (pid 51534)
02:55:13 system           | sending SIGTERM to worker_long.1 (pid 51536)
02:55:13 system           | sending SIGTERM to watch.1 (pid 51537)
02:55:13 system           | sending SIGTERM to redis_queue.1 (pid 51539)
02:55:13 system           | sending SIGTERM to web.1 (pid 51541)
02:55:13 system           | sending SIGTERM to schedule.1 (pid 51543)
02:55:13 system           | sending SIGTERM to worker_default.1 (pid 51545)
02:55:13 system           | sending SIGTERM to async_worker.1 (pid 51548)
02:55:13 system           | sending SIGTERM to redis_cache.1 (pid 51551)
02:55:13 system           | sending SIGTERM to worker.1 (pid 51553)
02:55:13 system           | sending SIGTERM to worker_short.1 (pid 51556)
02:55:13 system           | sending SIGTERM to longjob_worker.1 (pid 51557)
02:55:13 system           | sending SIGTERM to workerbeat.1 (pid 51559)
02:55:13 redis_queue.1    | 51539:signal-handler (1515041713) Received SIGTERM scheduling shutdown...
02:55:13 redis_cache.1    | 51551:signal-handler (1515041713) Received SIGTERM scheduling shutdown...
02:55:13 system           | web.1 stopped (rc=-15)
02:55:13 system           | watch.1 stopped (rc=-15)
02:55:13 system           | schedule.1 stopped (rc=-15)
02:55:13 system           | worker_default.1 stopped (rc=-15)
02:55:13 system           | longjob_worker.1 stopped (rc=-15)
02:55:13 system           | workerbeat.1 stopped (rc=-15)
02:55:13 system           | worker_long.1 stopped (rc=-15)
02:55:13 redis_cache.1    | 51551:M 04 Jan 02:55:13.275 # User requested shutdown...
02:55:13 redis_cache.1    | 51551:M 04 Jan 02:55:13.275 * Removing the pid file.
02:55:13 redis_cache.1    | 51551:M 04 Jan 02:55:13.276 # Redis is now ready to exit, bye bye...
02:55:13 system           | redis_cache.1 stopped (rc=0)
02:55:13 system           | redis_socketio.1 stopped (rc=-15)
02:55:13 system           | worker_short.1 stopped (rc=-15)
02:55:13 system           | async_worker.1 stopped (rc=-15)
02:55:13 system           | worker.1 stopped (rc=-15)
02:55:13 redis_queue.1    | 51539:M 04 Jan 02:55:13.320 # User requested shutdown...
02:55:13 redis_queue.1    | 51539:M 04 Jan 02:55:13.320 * Removing the pid file.
02:55:13 redis_queue.1    | 51539:M 04 Jan 02:55:13.320 # Redis is now ready to exit, bye bye...
02:55:13 system           | redis_queue.1 stopped (rc=0)

Apparently, SIGTERM is sending a signal to shutdown redis… I’ll keep going with the research, but will keep the information here and come back if I find something out.

Your ‘bench start’ log output has this that may be the problem - say an invalid command or argument:

02:55:13 socketio.1 | /bin/sh: {{: command not found

‘bench start’ and the other bench command scripts are here
frappe@erpnext:~/bench-repo/bench/commands$

but are not easy to trace or comprehend…

Please post your Procfile contents that may be part of the problem?

I used the Profile content from achillesrasquinha post of the bench repo on Github on this link

ok my guess is you are running the Procfile template itself that you placed here:

frappe@erpnext:~/frappe-bench$ ls -al Procfile
-rw-rw-r-- 1 frappe frappe 403 Jan 4 07:25 Procfile

Instead, first you must copy the template file to here:

frappe@erpnext:~/frappe-bench$ find …/bench-repo/ -name Procfile
…/bench-repo/bench/config/templates/Procfile

then run this:

frappe@erpnext:~/frappe-bench$ bench setup procfile

Here’s my Procfile for comparison:

redis_cache: redis-server config/redis_cache.conf
redis_socketio: redis-server config/redis_socketio.conf
redis_queue: redis-server config/redis_queue.conf
web: bench serve --port 8000

socketio: /usr/bin/node apps/frappe/socketio.js
watch: bench watch
schedule: bench schedule
worker_short: bench worker --queue short
worker_long: bench worker --queue long
worker_default: bench worker --queue default

hope this helps.

Hey thanks again for helping out!
After reading your message I found that i didn’t have the bench-repo, so I uninstalled the whole thing and tried the manual install of the GitHub page (instead of the Hitchhikers Guide to install on MacOS). After a few terminal commands, loads of downloads, update etc it seems to work ok!
Thanks a lot!

Nice to hear you are back underway lowercase00

When you must work under the hood you learn lots and that’s always good.

Have fun

1 Like