There was a problem loading init data

Hi everybody,
I just tried to clone n8n locally on my mac and to start it under http://localhost:8081. I get this message and can’t figure out what I’m missing.

There was a problem loading init data:
API-Server can not be reached. It is probably down.

Thanks for any advice,
Enrique

Is there a reason why you do not want to use the standard n8n port 5678?

Anyway, you then have to make sure to set some environment variables accordingly that everything knows how to find the backend. You can find information about that here:

Hi Jan, sorry… my mistake! Thanks anyways for the response! I’ll have a look on n8n and already love it from the first view!

It does not have to be a mistake. There are definitely good reasons not to run it on the default port. But at the beginning especially for the first tests, it is definitely the easiest.

Very great to hear! Hope that feeling gets even stronger the more you use it :wink:

And if you run in any problems simply post here. I do my best to help you asap. Have a great day!

1 Like

I used macOS also, It seems the default port when running ‘npm run dev’ is 8081 :slight_smile:
from n8n run dev log :

n8n-editor-ui : App running at:
n8n-editor-ui : - Local: http://localhost:8081/
n8n-editor-ui : - Network: http://192.168.43.42:8081/

I got this error too but it gone by it self and running again on port 5678 :blush:

By default does n8n start on port 5678. Only if you run the editor in development mode does it additionally serve it also from port 8080 (with hot-reload). If you have already something else running on 8080 then it starts on 8081 but will then not work because of cors.

1 Like

hey @jan im new to n8n, I pretty much liked it and started using the dev mode. By default its using the 8081 port and im getting the init error. i tried to use Nginx Configuration that you have suggested but that didnt work for me. I still getting init error. Can u plz help me out with this

Welcome to the community @Sarvani_Harshi!

Did you try port 5678?

thanks, @jan., yes was not even able to change the execute node in p tag to something else, and the page is not reloading in 5678, but then I re-executed the application still nothing changed
apart from these, I tried consoling the values
I was unable to do that as well

Sorry, do not understand what you mean with “was not even able to change the execute node in p tag to something else”.

Can you explain how you end up with port 8081. Because by default it starts on 5678.

thanks @jan i somehow figured a way i changed in port.js ans server.js from 8080 to 8081

Do sadly still not understand at all what is going on. There is is no port.js file and even in the server.js file there is also no port 8080 defined (except the one to allow to make CORS requests for local development).

What exactly is the problem you are having? Do you also have that problem if you do not change things in the n8n source code? Because if you do I can simply not support you as that is really not meant to happen. There is no need for users to change anything in the source code. Everything is set up in a way that it works out of the box and can be configured via environment variables.

Hi @jan i am working on local development code editer-ui, i have run program on localhost:8080, i have same problem

Welcome to the community @ah6442!

So is the editor-UI really starting on port 8080 or does it end up on a different port, because that would cause problems. Is it working normally if you access via port 5678?

by default its starting with 8080 port

when i was not on local development version then it was starting on 5678 but when i download packages and run editor-ui that is run on 8080 port by default

The editor-UI in development mode tries to start on 8080, but if that port is taken it uses another one like 8081. So if that happens it would cause problems and not work anymore.

If you do not make changes to the editor-UI there is no need to use the version running on port 8080, you can still use the “regular” one that gets served by the backend via port 5678.

i want to modify the editor-ui code, want to add different fields for my client

So just to make sure. If you open n8n now on http://localhost:5678 does it then work fine?

I can confirm the same behavior on OS X. Cloned the repo, ran the instructions here n8n/CONTRIBUTING.md at master · n8n-io/n8n · GitHub

With npm run dev, the application starts on http://localhost:8080 with the same screenshot from @ah6442 and all the resources attempting to load are failing with CORS errors for http://localhost:5678. I cannot access anything on http://localhost:5678 if I hit that directly.

These are the results for what is listening on 8080 and 5678:

ps -aef | grep 8080
  501 79842 79369   0  6:57PM ttys029    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn 8080
ps -aef | grep 5678
  501 78730 78723   0  6:42PM ttys028    0:00.08 node /path/to/n8n/packages/editor-ui/node_modules/.bin/cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vue-cli-service serve
  501 79769 79369   0  6:55PM ttys029    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn 5678

I’m not necessarily having an issue because I don’t need this to run with hot reload, but I figured since I came across this thread, I’d provide some helpful info.