I needed to reinstall ERPNext because on the first installation, domain list appeared empty, only allowing me to configure the system but with no module available.
Now I reinstalled ERPNext successfully and connected to the URL. The setup wizzard appeared, then I fill all information. At this time, system allowed me to select domains, what is ok.
However, when completed the wizard, an Internal Server error message is shown.
I think you canāt setup erpnext if you had already finished the wizard before. You could try the bench command bellow, and then, try to run the wizard again.
Just be aware that all your DB data will be wiped out as any other customizations that you had done to this site.
Always localhost is added automatically by any system to hosts file. During my 30 years of experience in computers, I have never had the need to add localhost to hosts file, neither in Linux nor Windows machines.
Definetely, this issue is caused by another problem. The fact is that I donāt know really how ERPNext works internally and why it is needed other elements such as redis and socket io servers.
The problem is communication between application running on port 8080 when communicating to port 9000 where socket io is listening.
However, that communication occurs several times during the wizard. Only at the end it fails.
I hope some guy that really knows ERPNext could give me some hand to detect the problem. Maybe some other log shows another cause.
take down firewalls and see what happens; if it works, itās a firewall config.
try a different browser; all of the references are to āhttp://localhostā/āhttp://::site::ā, but your POST error from chrome is referring to https://::site::- if you are using an extension like āhttps everywhereā or similar and your erp site isnāt set up yet for ssl, it could be throwing an error.
take a look at how the site is configured vs how you are connecting to it to do the initial setup; your errors areā¦ full-spectrum. You have references to localhost, 127.0.0.1, port 8000, port 8080, 9000; right alongside domains, hostnames, web addresses, and remote server ips. If youāre local- configure as local (nginx not setup; ports 8000, 8080, 9000); if youāre remote- configure as remote (nginx setup; ports 80, 443).
edit- after going back and looking at your post- it seems like the issue is that you are installing remotely and then trying to run setup on ālocalā port defaults. When you get to the āspecify domainā section, and give it the basic info, it kicks into āremoteā mode, activates nginx (which blocks the ālocalā ports and routes everything via 80/443), and whatever else settings changes the āspecify domainā section manages.
basically, yeah, Iām thinking it goes back to suggestion 3. if the machine is local, configure as local (skip domain until initial setup is successful). if the machine is remote, install via ssh cli, then configure via ssh cli (command line/frappe-bench) the domain/hostname/etc. Either way- make sure you arenāt changing the site connection settings via the site. thatās like trying to change a tire while driving down the road.
ERPNext is installed local and all calls are made locals. How can I configure nginx as local?
When using install script, it created automatic several things. It installed Python listening on port 8000, Redis Server listening on port 11000, on port 12000 and on port 13000.
I configured manually Nginx to listen on port 8020. And here is the trick. I set Apache to proxy calls from port 80 to port 8020.
All above works, because when I load http://www.site.com, ERPNext wizard appears (after I log in successfully using Administrator account). I can fill all information each wizard page requested. I can even upload the pictures (of mine and the brand logo) and select domains. When I complete the wizard and presses the last button, it runs several tasks but when it runs the task of setting default values, it throws a 502 Bad Gateway in Chrome, but in NGINX log, the error I have already shown.
By using Firefox, the error shown is the same.
Finally, the https is only for Apache. Locally, it uses only http.
I am playing now with timeouts,because the error is shown 2 min after the POST requestā¦ I am wondering what timeout value should I modify.
By seeing -t 120 parameter, I guessed that is the timeout.
I have finally changed supervisor.conf file to define 1200 as the timeout.
That way, process was 30 minutes processingā¦ at last, āFinishingā message appears and get stuck there forever.
I interrupted the process and started again. At this time, wizard started again, but after I entered my information, a message with āStarting Frappeā was shown and got stuck for ever.
I tried to look at the root cause of that issue as well, but found that it was ( Maybe ? ) a socketio issue. I am not real sure.
It would only appear when running bench on localhost, and would be resolved by one of two ways.
Reload the webpage when it fails at the end, and just go through the setup process again. This time it wonāt fail.
If in case that does not do the trick, Iāve found running
bench --site sitename migrate
to do the trick. It reads all json files and rebuilds the db, and syncs the help. Plus indexes the global search. But nothing to with socketio. Why this solves the issue, I havenāt figured out.
Nginx is a fully-functioning reverse proxy on its own- why do you need Apache to proxy calls it? Iām going to bet that somewhere in the nginx-Apache configuration is where youāre hitting walls during setup.
Since all of that is running locally amongst itself, you just connect to the python port (8000) via a web browser, and any other quick connections to you just kind of happen unseen in the background (primarily socketio port 9000 connections for file transfer).
Once you make it a live (web-hosted) site- whether just for local intranet or full, public access; basically when you configure your hostname- then the picture becomes:
Iām not sure how you are configuring the wholeā¦ apache and nginx thingā¦ but clearly, once you tell it to run on during the initial, browser-based setup, itās turning nginx on for āliveā site mode, kicking everything behind nginx and rerouting port 8000, along with everything else not 80/443, through nginx :: 80.
You end up getting a 502 at this point because Apache is routing traffic from 80 (you) :: 8020 (nginx)ā¦ which, after being told to run in āliveā-site mode, is now blocked. Try this- Iām not sure what youāre using apache for, but take it out of the equation for now.
Justā¦ make it as simple and straight forward as possible just to get past the web-based initial setup. THEN, you can start poking, playing, and rewriting config files because youāll have a baseline to go back to.
As I said in the first post, I recommend either setting up for local OR āliveā via command line (when the only port used is 22ā¦ or none if you are legit physically local) and then sticking to that setup through the initial web-based admin configuration. If you are wanting to set up for a āliveā site at an address- even for local intranet use and not public use- set up the hostname configurations/nginx setup/multi_tenant_mode PRIOR to accessing the web-based admin setup.
By the way- multi_tenant_mode is what allows you to set up non-standard ports like 8020; search for āmulti_tenant_modeā or āmulti tenantā on here for several guides.
The important bit, though-
ālocalā-access based site :: like 4-5 ports, the main ones being 8000,9000
āliveā-access based site :: 80/443, with nginx serving as gateway/proxy to coordinate everything
IF you insist on configuring āliveā-access via ālocalā-ports, you HAVE to make sure that the āliveā-access ports are opened, configured, and redirecting properly in order to maintain a connection when the switch goes into effect. But again. configure access via cli-not the web browser. youāre just asking for issues doing it that way. and with the whole apache thing. Now youāre not just trying to change a tire while driving- youāre trying to do it with a ratchet turning a tire iron.
In the server I have Apache running serving other sites (of course, using port 80). Nginx is used only for ERPNext. That is why I need to proxy it from Apache (I want ERPNext to be accessed without the port).
I am not sure if you have read other posts by me. I told that the 502 error was because connection is suddenly interrupted when calling port 8000, and it was due a time out of 2 minutes. I donāt know why the system lasts too much to configure, but the error I was receiving was only due to that timeout. This has nothing to do with the Apache and Nginx themselves.
Now the question should be, is it normal to last too much in setting up ERP next?
Someone has suggest me to do a āmigrateā, but I am not sure if this will solve it.
When you connect ālocallyā on port 8000, then select a domain VIA WEB-BASED SETUP, the system setup routine switches from ālocalā operation (port 8000) over to ālive-siteā/domain-setup nginx-proxied port 80. When this occurs, your apache proxy-- still pointing at 8000 (or whatever custom port you are using)-- loses connection since ERPnext is no longer using that port- itās trying to use port 80, but port 80 is already being used by Apache for your other sites.
In a normal domain setup, the WEB-BASED SETUP might work fine, but you have Apache set up to proxy to custom ālocalā-use access ports and then proceed to tell ERPNext to configure for completely different domain/āliveā-use ports.
The system isnāt taking that long to configure. Itās doing the first couple of things on the list (which may give the appearance of setup progressing normally), then itās getting to your domain selection where it proceeds to turn off port 8000 and turn on port 80. Hell, it may even be successfully finishing the setup process, but you get a 502/port 8000 timeout because the system has closed port 8000 and switched over to port 80 per default ādomainā/āliveā-site settings and so never get to see it.
Hereās the standard way to setup a āliveā site with port-based multitenancy is:
From terminal on either your current install or a fresh install:
bench update
bench use {site}
bench set-config hostname {domain name}
bench set-config host_name {domain name}
bench config dns_multitenant off
**bench config use-nginx-port {site- as in the name of your site's folder in bench/sites} {port}**
bench setup nginx
sudo service nginx reload
sudo bench restart
Butā¦ that wonāt really work for you since youāre not setting up multitenancy of erpnext sites on the same server being proxied to via nginx- youāre trying to to setup multitenancy of erpnext and other existing sites that are being proxied to via Apache. So, really itās the same thing, just applied to Apacheā¦
For ERPNext, from the server terminal on your current or a fresh install, run from the frappe-bench directory:
bench update
bench config dns_multitenant on
bench new-site {site_name} **OR** bench use {site_name}
bench set-config hostname {domain- ie, 'http://{site_name}'}
bench set-confg host_name {domain- ie, 'http://{site_name}'} **I know it's redundant, and honestly one of them probably isn't needed, but I do it that way because everything works when it has both..
bench setup nginx
sudo service nginx reload
bench use {site}
At this point, your installation should be live on port 80, which, of course, will be inaccessibleā¦ until you setup multitenancy in Apache to serve ERPNext. I honestly donāt know all that much about Apache, but assuming similarity to nginx/traefik/proxy servers in general, you should likely be able to do some form of dns-based multitenancy to route {erp site}:80 traffic to {erp site}:80 while still routing {website}:80 to {website}:80. As far as I can recall, using port-based multitenancy (as you seem be going for) would always require the port to be specified, which you said you didnāt want to have to do.
The key points, though, are:
domain/dns/port configurations like this need to be done through command line/port 22 SSH, not the web-based interface.
Ultimately, you should be aiming at a normal, no-special-config ERPNext installation that is proxied by your special-config Apache, which is providing the multi-tenancy proxy since it is the bit that is web-facing.
you will not believe it. I have run wizard again, but before, I have changed some mysql configuration as shown here and changed proxies timeouts as shown here . Then, wizard did not take too long and finally I could load ERPNext with all domains! I hope everything have been installed correctly.