Trying to change port but I messed it up

My default port is 8080 and I’ve installed ERPNext on Oracle VM VirtualBox

I’ve been trying to change the port using this:

cd frappe-bench
bench set-nginx-port erpnext.vm 9000
bench setup nginx
sudo service nginx reload

Then now I can’t even connect to ERPNext using my browser (either it’s 8080 or 9000). What should I do now?

are you use production or develop?

Maybe try editing this file:

Either that or just run the same commands again using 8000 as the port.


Excuse me but how could I edit that file? I am using Oracle VirtualBox and all I see is just a black console.

Have you tried just repeating your commands swapping 9000 for 8000?

cd frappe-bench
bench set-nginx-port erpnext.vm 8000
bench setup nginx
sudo service nginx reload

I have never tried changing my nginx ports so I am guessing here… But If the above fails maybe try this from within /frappe-bench/
This list of commands should over-write any changes made. Again I haven’t made the changes like you have so am kind of guessing here.

sudo supervisorctl stop all
sudo service nginx stop
bench setup config
bench setup redis
bench setup supervisor
bench setup nginx
bench setup procfile
sudo bench setup sudoers frappe
sudo nginx -t # check if this command shows any error
sudo service nginx reload
sudo supervisorctl reread
sudo supervisorctl update

1 Like

I’ve already tried the commands to switch back to 8080. No luck. I tried running a stock ova image and it worked like a charm.

Here is what it looks like when I try to connect. The problem is my database is quite big now so if I start it over again I will take a lot of time.

Is there any mothod that I can export my database and import it to the stock .ova? Or commands that restore my settings to stock?

bench mysql
Will display the SQL Console.
This might help?
Otherwise checking the stock ova image vs your VM might enable you see what changes have been made with the commands you issued?
sudo nano /home/frappe/frappe-bench/sites/common_site_config.json
sudo nano /home/frappe/frappe-bench/config/nginx.conf
Then restarting nginx and supervisor might help?
Good Luck

This might help as well

1 Like

Thank you so much for replying. Finally I can connect to localhost:8080 but this error occured:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/”, line 32, in render
data = render_page_by_language(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/”, line 88, in render_page_by_language
user_lang = guess_language(translated_languages)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 27, in guess_language
lang_list = get_all_languages() or []
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 82, in get_all_languages
return frappe.cache().get_value(‘languages’, _get)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 68, in get_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 81, in _get
return frappe.db.sql_list(‘select name from tabLanguage’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 205, in sql_list
return [r[0] for r in self.sql(query, values, debug=debug)]
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 148, in sql
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1146, “Table ‘d56cb677eaab3383.tabLanguage’ doesn’t exist”)

Is it something wrong with my database?

It looks like this

When logging into ERPNext for the first time you should have been prompted to selected a language.
Did this happen?