Try ERPNext Buy Support Partners Foundation Foundation Members

[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: https://go.microsoft.com/fwlink/?linkid=830387
“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