[Solved] Bench start successfully ,but unable to connect with localhost:8000(using erpnext in vscode)

Hi I am trying to use vscode for debugging in frappe framework.
I have followed guideline given here
VSCode Debugging for Frappe Python

updated the procfile (prepend #)

Update launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: Debugging in Visual Studio Code
“version”: “0.2.0”,
“configurations”: [
{
“name”: “Bench”,
“type”: “python”,
“request”: “launch”,
“program”: “${workspaceFolder}/frappe/frappe/utils/bench_helper.py”,
“args”: [
“frappe”, “serve”, “–port”, “8000”, “–noreload”, “–nothreading”
],
“pythonPath”: “${workspaceFolder}/…/env/bin/python”,
“cwd”: “${workspaceFolder}/…/sites”,
“env”: {
“DEV_SERVER”: “1”
}
},
{
“type”: “node”,
“request”: “launch”,
“name”: “Launch Program”,
“program”: “${file}”
}
]
}

Execute bench start (looks like bench started success fully

frappe@frappe-VirtualBox:~/frappe-bench$ bench start
13:15:57 system | worker_long.1 started (pid=3723)
13:15:57 system | worker_default.1 started (pid=3727)
13:15:57 system | schedule.1 started (pid=3731)
13:15:57 system | redis_queue.1 started (pid=3728)
13:15:57 redis_queue.1 | 3739:M 22 Oct 13:15:57.015 * Increased maximum number of open files to 10032 (it was originally set to 1024).
13:15:57 redis_queue.1 | .
13:15:57 redis_queue.1 | .-__ ''-._ 13:15:57 redis_queue.1 | _.- . . ‘’-._ Redis 3.0.6 (00000000/0) 64 bit
13:15:57 redis_queue.1 | .- .-```. ```\/ _.,_ ''-._ 13:15:57 redis_queue.1 | ( ' , .-` | `, ) Running in standalone mode 13:15:57 redis_queue.1 | |`-._`-...-` __...-.-.|'_.-'| Port: 11000 13:15:57 redis_queue.1 | | -. ._ / _.-' | PID: 3739 13:15:57 redis_queue.1 | -._ -._ -./ .-’ .-’
13:15:57 redis_queue.1 | |-._-.
-.__.-' _.-'_.-'| 13:15:57 redis_queue.1 | | -.
-._ _.-'_.-' | http://redis.io 13:15:57 redis_queue.1 | -._ -._-..-'.-’ .-’
13:15:57 redis_queue.1 | |-._-.
-.__.-' _.-'_.-'| 13:15:57 redis_queue.1 | | -.
-._ _.-'_.-' | 13:15:57 redis_queue.1 | -._ -._-.
.-‘.-’ .-’
13:15:57 redis_queue.1 | -._ -..-’ _.-’
13:15:57 redis_queue.1 | -._ _.-' 13:15:57 redis_queue.1 | -.
.-’
13:15:57 redis_queue.1 |
13:15:57 redis_queue.1 | 3739:M 22 Oct 13:15:57.015 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
13:15:57 redis_queue.1 | 3739:M 22 Oct 13:15:57.015 # Server started, Redis version 3.0.6
13:15:57 redis_queue.1 | 3739:M 22 Oct 13:15:57.015 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
13:15:57 redis_queue.1 | 3739:M 22 Oct 13:15:57.015 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
13:15:57 redis_queue.1 | 3739:M 22 Oct 13:15:57.015 * The server is now ready to accept connections on port 11000
13:15:57 system | redis_cache.1 started (pid=3729)
13:15:57 redis_cache.1 | 3744:M 22 Oct 13:15:57.021 * Increased maximum number of open files to 10032 (it was originally set to 1024).
13:15:57 redis_cache.1 | .
13:15:57 redis_cache.1 | .-__ ''-._ 13:15:57 redis_cache.1 | _.- . . ‘’-.
Redis 3.0.6 (00000000/0) 64 bit
13:15:57 redis_cache.1 | .- .-```. ```\/ _.,_ ''-._ 13:15:57 redis_cache.1 | ( ' , .-` | `, ) Running in standalone mode 13:15:57 redis_cache.1 | |`-._`-...-` __...-.-.
|’_.-'| Port: 13000 13:15:57 redis_cache.1 | | -._ ._ / _.-' | PID: 3744 13:15:57 redis_cache.1 | -._ -._ -./ .-’ .-’
13:15:57 redis_cache.1 | |-._-.
-.__.-' _.-'_.-'| 13:15:57 redis_cache.1 | | -.
-._ _.-'_.-' | http://redis.io 13:15:57 redis_cache.1 | -._ -._-..-'.-’ .-’
13:15:57 redis_cache.1 | |-._-.
-.__.-' _.-'_.-'| 13:15:57 redis_cache.1 | | -.
-._ _.-'_.-' | 13:15:57 redis_cache.1 | -._ -._-.
.-‘.-’ .-’
13:15:57 redis_cache.1 | -._ -..-’ _.-’
13:15:57 redis_cache.1 | -._ _.-' 13:15:57 redis_cache.1 | -.
.-’
13:15:57 redis_cache.1 |
13:15:57 redis_cache.1 | 3744:M 22 Oct 13:15:57.021 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
13:15:57 redis_cache.1 | 3744:M 22 Oct 13:15:57.021 # Server started, Redis version 3.0.6
13:15:57 redis_cache.1 | 3744:M 22 Oct 13:15:57.021 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
13:15:57 redis_cache.1 | 3744:M 22 Oct 13:15:57.021 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
13:15:57 redis_cache.1 | 3744:M 22 Oct 13:15:57.021 * The server is now ready to accept connections on port 13000
13:15:57 system | watch.1 started (pid=3732)
13:15:57 system | redis_socketio.1 started (pid=3730)
13:15:57 redis_socketio.1 | 3748:M 22 Oct 13:15:57.039 * Increased maximum number of open files to 10032 (it was originally set to 1024).
13:15:57 redis_socketio.1 | .
13:15:57 redis_socketio.1 | .-__ ''-._ 13:15:57 redis_socketio.1 | _.- . . ‘’-.
Redis 3.0.6 (00000000/0) 64 bit
13:15:57 redis_socketio.1 | .- .-```. ```\/ _.,_ ''-._ 13:15:57 redis_socketio.1 | ( ' , .-` | `, ) Running in standalone mode 13:15:57 redis_socketio.1 | |`-._`-...-` __...-.-.
|’_.-'| Port: 12000 13:15:57 redis_socketio.1 | | -._ ._ / _.-' | PID: 3748 13:15:57 redis_socketio.1 | -._ -._ -./ .-’ .-’
13:15:57 redis_socketio.1 | |-._-.
-.__.-' _.-'_.-'| 13:15:57 redis_socketio.1 | | -.
-._ _.-'_.-' | http://redis.io 13:15:57 redis_socketio.1 | -._ -._-..-'.-’ .-’
13:15:57 redis_socketio.1 | |-._-.
-.__.-' _.-'_.-'| 13:15:57 redis_socketio.1 | | -.
-._ _.-'_.-' | 13:15:57 redis_socketio.1 | -._ -._-.
.-‘_.-’ _.-’
13:15:57 redis_socketio.1 | -._ -..-’ _.-’
13:15:57 redis_socketio.1 | -._ _.-' 13:15:57 redis_socketio.1 | -.
.-’
13:15:57 redis_socketio.1 |
13:15:57 redis_socketio.1 | 3748:M 22 Oct 13:15:57.039 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
13:15:57 redis_socketio.1 | 3748:M 22 Oct 13:15:57.039 # Server started, Redis version 3.0.6
13:15:57 redis_socketio.1 | 3748:M 22 Oct 13:15:57.039 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
13:15:57 redis_socketio.1 | 3748:M 22 Oct 13:15:57.040 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
13:15:57 redis_socketio.1 | 3748:M 22 Oct 13:15:57.040 * The server is now ready to accept connections on port 12000
13:15:57 system | socketio.1 started (pid=3735)
13:15:57 system | worker_short.1 started (pid=3740)
13:15:58 socketio.1 | listening on *: 9000
13:16:06 watch.1 | yarn run v1.19.1
13:16:06 watch.1 | $ node rollup/watch.js
13:16:07 watch.1 |
13:16:07 watch.1 | Rollup Watcher Started
13:16:07 watch.1 |
13:16:07 watch.1 | Watching…
13:16:08 watch.1 | Rebuilding frappe-web.css
13:16:08 watch.1 | Rebuilding chat.js
13:16:10 watch.1 | Rebuilding frappe-web.min.js
13:16:11 watch.1 | Rebuilding control.min.js
13:16:14 watch.1 | Rebuilding dialog.min.js
13:16:15 watch.1 | Rebuilding desk.min.css
13:16:15 watch.1 | Rebuilding frappe-rtl.css
13:16:15 watch.1 | Rebuilding desk.min.js
13:16:18 watch.1 | Rebuilding module.min.css
13:16:18 watch.1 | Rebuilding form.min.css
13:16:18 watch.1 | Rebuilding form.min.js
13:16:18 watch.1 | (node:3812) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added. Use emitter.setMaxListeners() to increase limit
13:16:20 watch.1 | Rebuilding list.min.css
13:16:20 watch.1 | Rebuilding list.min.js
13:16:21 watch.1 | Rebuilding report.min.css
13:16:21 watch.1 | Rebuilding report.min.js
13:16:23 watch.1 | Rebuilding web_form.min.js
13:16:23 watch.1 | Rebuilding web_form.css
13:16:23 watch.1 | Rebuilding print_format_v3.min.js
13:16:24 watch.1 | Rebuilding email.css
13:16:24 watch.1 | Rebuilding erpnext.css
13:16:24 watch.1 | Rebuilding marketplace.css
13:16:25 watch.1 | Rebuilding erpnext-web.min.js
13:16:25 watch.1 | Rebuilding erpnext-web.css
13:16:25 watch.1 | Rebuilding marketplace.min.js
13:16:28 watch.1 | Rebuilding erpnext.min.js
13:16:28 watch.1 | Rebuilding item-dashboard.min.js

but when i hit http://localhost:8000/ from browser it says unable to connect .
Can someone please suggest me where i am doing it incorrectly.

thanks

Kill it and try restarting. You need to find something like the following in the logs

* Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)

1 Like

Thanks crafter for your instant reply.
I am not able to find log file , where it is ??
Does the log that i have seen in terminal is the one that you have suggested ??
i am unable to get anything like http://0.0.0.0:8000. I have prepend# on procfile as per guide on the line web: bench serve --port 8000 and updated the lounch.json as

“args”: [
“frappe”, “serve”, “–port”, “8000”, “–noreload”, “–nothreading”

did not get where to see the logs file.
Please help me
Thanks

The console logs are what you displayed.

there are log files, in
/your/erpnext/path/frappe-bench/logs

1 Like

I have searched there ,i am unable to get anything like http://0.0.0.0:8000.
what i have found is
The server is now ready to accept connections on port 1100,Ihave tried it with http://localhost:11000/ and it gives a responce as -ERR wrong number of arguments for ‘get’ command.
But not getting how to get he login page

Yes, That is what I said. you should be looking for that and it was not in your logs that you posted.

Have you tried restarting?

1 Like

yes ,tried but no success,
I have searched console logs ,i am unable to get anything like http://0.0.0.0:8000.
what i have found is
The server is now ready to accept connections on port 1100,Ihave tried it with http://localhost:11000/ and it gives a responce as -ERR wrong number of arguments for ‘get’ command.
But not getting how to get he login page

in frappe-bench/log/frppe.log

[DEBUG] 2019-10-22 16:49:47,646 | /home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py:
Site: site1.local
Queued events for site site1.local
[DEBUG] 2019-10-22 16:50:47,830 | /home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py:
Site: site1.local
Queued events for site site1.local
[DEBUG] 2019-10-22 16:51:48,014 | /home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py:
Site: site1.local
Queued events for site site1.local
[DEBUG] 2019-10-22 16:57:50,308 | /home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py:
Site: site1.local
Queued events for site site1.local

nothing like http://0.0.0.0:8000.

I am using vscode ,is there any other place to check

if we use bench serve instead of bench start we can go into the login screen but after that it stuck at verifying
image

Please help , I am not getting how to resolve this .
I want to use debugger in erpnext ,Is there any other way or tools that helps .
Thanks

Hi
I have made a silly mistake.
I am running bench start and then accessing the url as http://localhost:8000/ as we are doing it usually.
but as tutorial suggest we have to bench start =>start debug mode => then only we can access the url.

Thanks for your kind help

Hello Sir,

I am also using VSCode, bench started succesfully…but not able to access it with url ----http://localhost:8000/.

Could you please tell me what steps you used to achieve the same. These are my logs on bench start,

23:17:33 socketio.1 | listening on *: 9000
23:17:34 schedule.1 | WARN: bench is installed in editable mode!
23:17:34 schedule.1 |
23:17:34 schedule.1 | This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench
23:17:34 schedule.1 |
23:17:34 web.1 | WARN: bench is installed in editable mode!
23:17:34 web.1 |
23:17:34 web.1 | This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench
23:17:34 web.1 |
23:17:34 watch.1 | WARN: bench is installed in editable mode!
23:17:34 watch.1 |
23:17:34 watch.1 | This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench
23:17:34 watch.1 |
23:17:38 web.1 | * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
23:17:38 web.1 | * Restarting with inotify reloader
23:17:38 watch.1 | yarn run v1.22.5
23:17:39 watch.1 | $ node rollup/watch.js
23:17:40 web.1 | * Debugger is active!
23:17:40 web.1 | * Debugger PIN: 302-068-939
23:17:40 watch.1 |
23:17:40 watch.1 | Rollup Watcher Started
23:17:40 watch.1 |
23:17:40 watch.1 | Watching…
23:17:42 watch.1 | Rebuilding frappe-web-b4.css
23:17:42 watch.1 | Rebuilding frappe-chat-web.css
23:17:42 watch.1 | Rebuilding chat.js
23:17:44 watch.1 | Rebuilding frappe-recorder.min.js
23:17:49 watch.1 | Rebuilding checkout.min.js
23:17:49 watch.1 | Rebuilding frappe-web.min.js
23:17:52 watch.1 | Rebuilding bootstrap-4-web.min.js
23:17:53 watch.1 | Rebuilding control.min.js
23:17:56 watch.1 | Rebuilding dialog.min.js
23:17:59 watch.1 | Rebuilding desk.min.css
23:17:59 watch.1 | Rebuilding frappe-rtl.css
23:17:59 watch.1 | Rebuilding printview.css
23:17:59 watch.1 | Rebuilding desk.min.js
23:18:06 watch.1 | Rebuilding module.min.css
23:18:06 watch.1 | Rebuilding form.min.css
23:18:06 watch.1 | Rebuilding form.min.js
23:18:09 watch.1 | Rebuilding list.min.css
23:18:09 watch.1 | Rebuilding list.min.js
23:18:11 watch.1 | Rebuilding report.min.css
23:18:11 watch.1 | Rebuilding report.min.js
23:18:13 watch.1 | Rebuilding web_form.min.js
23:18:15 watch.1 | Rebuilding web_form.css
23:18:15 watch.1 | Rebuilding email.css
23:18:15 watch.1 | Rebuilding social.min.js
23:18:16 watch.1 | Rebuilding modules.min.js
23:18:17 watch.1 | Rebuilding barcode_scanner.min.js
23:18:19 watch.1 | Rebuilding data_import_tools.min.js

It would be really great if you help on this…Thanks

check listening port

sudo lsof -i -P -n | grep LISTEN

1 Like

serah@0da2c7a3e07b:~/frappe-bench$ sudo lsof -i -P -n | grep LISTEN
[sudo] password for serah:
node 66 root 18u IPv6 16369 0t0 TCP *:45655 (LISTEN)

This is the result I got

It would be like below

redis-ser 810 frappe 6u IPv4 21732 0t0 TCP 127.0.0.1:13000 (LISTEN)
redis-ser 811 frappe 6u IPv4 22906 0t0 TCP 127.0.0.1:12000 (LISTEN)
node 812 frappe 18u IPv6 23999 0t0 TCP *:9000 (LISTEN)
gunicorn 819 frappe 5u IPv4 23592 0t0 TCP 127.0.0.1:8000 (LISTEN)
miniserv. 833 root 7u IPv4 22956 0t0 TCP *:10000 (LISTEN)
miniserv. 833 root 8u IPv6 22957 0t0 TCP *:10000 (LISTEN)
gunicorn 936 frappe 5u IPv4 23592 0t0 TCP 127.0.0.1:8000 (LISTEN)
gunicorn 937 frappe 5u IPv4 23592 0t0 TCP 127.0.0.1:8000 (LISTEN)

it means your port is not open.

sudo ufw status
sudo ufw allow 8000

serah@0da2c7a3e07b:~/frappe-bench$ sudo ufw status
sudo: ufw: command not found
serah@0da2c7a3e07b:~/frappe-bench$ sudo ufw allow 8000
sudo: ufw: command not found

Command not found

UFW - Uncomplicated Firewall
No need now.

what are you trying in browser?

I am trying to access with this URL- http://localhost:8000/,

Also tried with the configured site also like http://test-dev:8000/,
but no hope

Followed these steps for installaton - The Hitchhiker's Guide to Installing Frappe on Linux · frappe/frappe Wiki · GitHub

On which platform have you installed? Server Name and OS ?

try with your IP:8000 instead of http://test-dev:8000/

Ubuntu 20.04.1 LTS, used frappe_docker

----frappe_docker/development at main · frappe/frappe_docker · GitHub

Tried with ip, still site cant be reached :pensive:

There is the only an option for windows and macOS. i dont have any idea about docker will work on ubuntu or not. sorry for that.