bench icon indicating copy to clipboard operation
bench copied to clipboard

404 page not found

Open jonas-kupferschmid opened this issue 2 years ago • 14 comments

Issue: Bug report

Do the checklist before filing an issue:

  • [x] Can you replicate the issue on the supported bench versions?
  • [ ] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome

Describe the bug :chart_with_downwards_trend: I have been stuck for days getting erpnext running. Help is greatly appreciated After following installation instructions. When doing the manual installation and after

bench init frappe-bench 
cd frappe-bench 
bench new-site mysitename

I still get 404 error when visiting http://127.0.0.1:8000/. (somehow easy install with docker also doesn't work for me) also the same after installing erpnext onto the site

bench get-app erpnext
bench --site  mysitename install-app erpnext

The warnings I get when bench init:

Warning message
warning " > @frappe/[email protected]" has unmet peer dependency "less@^4.x".
warning " > @frappe/[email protected]" has unmet peer dependency "stylus@^0.x".
warning " > @vue/[email protected]" has unmet peer dependency "vue-template-compiler@*".
$ supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
WARN: restarting supervisor failed. Use `bench restart` to retry.
$ bench build

 WARN  Cannot connect to redis_cache to update assets_json
 WARN  Cannot connect to redis_cache to update assets_json

After bench new-site mySiteName and bench start I get the following

''' bench start 21:58:46 system | web.1 started (pid=15925) 21:58:46 system | redis_cache.1 started (pid=15929) 21:58:46 system | worker.1 started (pid=15928) 21:58:46 system | socketio.1 started (pid=15927) 21:58:46 system | redis_queue.1 started (pid=15926) 21:58:46 system | schedule.1 started (pid=15930) 21:58:46 system | watch.1 started (pid=15931) 21:58:46 redis_cache.1 | 15929:C 07 Jan 2024 21:58:46.898 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 21:58:46 redis_queue.1 | 15926:C 07 Jan 2024 21:58:46.898 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 21:58:46 redis_cache.1 | 15929:C 07 Jan 2024 21:58:46.898 * Redis version=7.2.3, bits=64, commit=00000000, modified=0, pid=15929, just started 21:58:46 redis_cache.1 | 15929:C 07 Jan 2024 21:58:46.898 * Configuration loaded 21:58:46 redis_queue.1 | 15926:C 07 Jan 2024 21:58:46.898 * Redis version=7.2.3, bits=64, commit=00000000, modified=0, pid=15926, just started 21:58:46 redis_queue.1 | 15926:C 07 Jan 2024 21:58:46.898 * Configuration loaded 21:58:46 redis_cache.1 | 15929:M 07 Jan 2024 21:58:46.899 * Increased maximum number of open files to 10032 (it was originally set to 256). 21:58:46 redis_cache.1 | 15929:M 07 Jan 2024 21:58:46.899 * monotonic clock: POSIX clock_gettime 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.899 * Increased maximum number of open files to 10032 (it was originally set to 256). 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.899 * monotonic clock: POSIX clock_gettime 21:58:46 redis_cache.1 | 15929:M 07 Jan 2024 21:58:46.901 * Running mode=standalone, port=13000. 21:58:46 redis_cache.1 | 15929:M 07 Jan 2024 21:58:46.901 # WARNING: The TCP backlog setting of 511 cannot be enforced because kern.ipc.somaxconn is set to the lower value of 128. 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.901 * Running mode=standalone, port=11000. 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.901 # WARNING: The TCP backlog setting of 511 cannot be enforced because kern.ipc.somaxconn is set to the lower value of 128. 21:58:46 redis_cache.1 | 15929:M 07 Jan 2024 21:58:46.902 * Server initialized 21:58:46 redis_cache.1 | 15929:M 07 Jan 2024 21:58:46.902 * Ready to accept connections tcp 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.902 * Server initialized 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.902 * Loading RDB produced by version 7.2.3 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.902 * RDB age 85 seconds 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.902 * RDB memory usage when created 1.54 Mb 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.903 * Done loading RDB, keys loaded: 3, keys expired: 1. 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.903 * DB loaded from disk: 0.001 seconds 21:58:46 redis_queue.1 | 15926:M 07 Jan 2024 21:58:46.903 * Ready to accept connections tcp 21:58:47 socketio.1 | Realtime service listening on: 9000 21:58:47 watch.1 | 21:58:47 web.1 | /Users/jonas/Desktop/erpnext/frappe-bench/env/lib/python3.11/site-packages/passlib/utils/init.py:854: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13 21:58:47 web.1 | from crypt import crypt as _crypt 21:58:47 web.1 | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. 21:58:47 web.1 | * Running on all addresses (0.0.0.0) 21:58:47 web.1 | * Running on http://127.0.0.1:8000 21:58:47 web.1 | * Running on http://198.18.192.225:8000 21:58:47 web.1 | Press CTRL+C to quit 21:58:47 web.1 | * Restarting with stat 21:58:48 watch.1 | yarn run v1.22.21 21:58:48 watch.1 | $ node esbuild --watch --live-reload 21:58:48 web.1 | /Users/jonas/Desktop/erpnext/frappe-bench/env/lib/python3.11/site-packages/passlib/utils/init.py:854: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13 21:58:48 web.1 | from crypt import crypt as _crypt 21:58:48 web.1 | * Debugger is active! 21:58:48 web.1 | * Debugger PIN: 626-875-895 21:59:00 watch.1 | Watching for changes... 21:59:43 web.1 | 127.0.0.1 - - [07/Jan/2024 21:59:43] "GET / HTTP/1.1" 404 - '''

and bench restart gives me the following error:

bench restart
$ supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
ERROR: supervisorctl restart frappe:
subprocess.CalledProcessError: Command 'supervisorctl restart frappe:' returned non-zero exit status 2.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/jonas/anaconda3/bin/bench", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/jonas/anaconda3/lib/python3.11/site-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/Users/jonas/anaconda3/lib/python3.11/site-packages/bench/commands/utils.py", line 41, in restart
    Bench(".").reload(web, supervisor, systemd)
  File "/Users/jonas/anaconda3/lib/python3.11/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/jonas/anaconda3/lib/python3.11/site-packages/bench/bench.py", line 152, in reload
    restart_supervisor_processes(bench_path=self.name, web_workers=web, _raise=_raise)
  File "/Users/jonas/anaconda3/lib/python3.11/site-packages/bench/utils/bench.py", line 321, in restart_supervisor_processes
    failure = bench.run(f"{sudo}supervisorctl restart {group}", _raise=_raise)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jonas/anaconda3/lib/python3.11/site-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jonas/anaconda3/lib/python3.11/site-packages/bench/utils/__init__.py", line 158, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: supervisorctl restart frappe:

OS (please complete the following information): :cyclone:

  • [x] macOS: 14.1.2 M2 chip

Version Information

  • Bench Branch: 5.19.0
  • Frappe Version: 16.0.0-dev
  • ERPNext Version:

jonas-kupferschmid avatar Jan 07 '24 14:01 jonas-kupferschmid

same Issue here.... Always 404 after easy-install script.

mSIESTE avatar Jan 19 '24 07:01 mSIESTE

I am facing the same issue after using the easy-install script

Guhan-SenSam avatar Feb 22 '24 18:02 Guhan-SenSam

facing the same issue but the entry point for me is 127.0.0.1

TheGodFather05 avatar Feb 25 '24 06:02 TheGodFather05

Same here. Used the easy install script but not being able to acces. Even getting a 404 when trying to access by IP address. Setup VM server (Ubuntu). Run the script as documented on Github.

rolero avatar Mar 18 '24 20:03 rolero

I solved it using public valid FQDN like app.domain.com and open ports 80 and 443.

smartdigit avatar Apr 10 '24 08:04 smartdigit

sudo nano /var/lib/docker/volumes/frappe_sites/_data/common_site_config.json there is that site1.localhost

I've entered my erp public fqdn name there instead, rebooted the server aaaaand... the container didn't start automatically.

So I've rerun the python "easy"-setup script aaaand... I'm back where I've started, but with an fqdn in common_site_config.json

Great job done testing your "erp", developer.

Debian 11.8 (because rip ubuntu and centos).

alvolalex avatar Apr 11 '24 02:04 alvolalex

still same issue here running easy-install script everything went fine.

Log says

2024-05-04 14:22:32,297 - INFO - Running Production Setup 2024-05-04 14:23:58,757 - INFO - Docker Compose file generated at ~/frappe-compose.yml 2024-05-04 14:26:06,681 - INFO - New site creation completed

this is the full log nothing more

Clankcoll avatar May 05 '24 00:05 Clankcoll

The best i get is when i run is

2024-05-05 00:54:57,307 - INFO - Running Production Setup 2024-05-05 00:55:02,425 - INFO - Docker Compose file generated at ~/frappe-compose.yml 2024-05-05 00:55:03,279 - ERROR - Bench site creation failed for clanktech Traceback (most recent call last): File "/root/frappe_docker/easy-install.py", line 291, in create_site subprocess.run( File "/usr/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/usr/bin/docker', 'compose', '-p', 'frappe', 'exec', 'backend', 'bench', 'new-site', 'clanktech', '--no-mariadb-socket', '--db-root-password', '16014a208', '--admin-password', 'e36b04aa2989', '->9', '--install-app', 'erpnext', '--set-default']' returned non-zero exit status 1.

no worrys about the passwords since it is not internet facing and be destroyed and pulled a thousand times

Clankcoll avatar May 05 '24 00:05 Clankcoll

fixed when using the command bench use {your-site-name}

kcashique avatar Sep 07 '24 17:09 kcashique

fixed when using the command bench use {your-site-name}

you saved me! boss. there was no error log but i was faced with that issued. thank you

wissedenis avatar Oct 13 '24 11:10 wissedenis

When installing using the easy-install.py script, make sure that you add the --sitename argument, e.g:

python3 easy-install.py --prod --sitename yoursite.yourdomain.com --email [email protected]

You will need to point said sitename to the IP of your server via DNS entry or editing your hosts file while testing/getting up and running.

xkalib3r avatar Oct 25 '24 08:10 xkalib3r

fixed when using the command bench use {your-site-name}

It seems the bench use command is no longer available in bench

JoeBrar avatar Jun 15 '25 16:06 JoeBrar

I was getting this same issue. Here's how I solved it - link

JoeBrar avatar Jun 15 '25 18:06 JoeBrar

fixed when using the command bench use {your-site-name}

It seems the bench use command is no longer available in bench

bench use command still working in bench and available. refer bench --help

ashique-tridz avatar Jun 16 '25 07:06 ashique-tridz