Haufe-Lexware / wicked.haufe.io

An API Management system based on Mashape Kong
http://wicked.haufe.io
Other
121 stars 37 forks source link

Error building dev env on Windows #262

Closed Paulo-Weber closed 4 years ago

Paulo-Weber commented 4 years ago

I have a similar error as the described on this issue. The portal can't find the access token, image

I had tried the build.sh script, as the npm install on all the subfolders (and ./install.sh) but it still didn't work.

Logs from ui-error.log:

Error: connect ECONNREFUSED 10.1.27.8:3001
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
checkConfigHash(): An error occurred.
Error: connect ECONNREFUSED 10.1.27.8:3001
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '10.1.27.8',
  port: 3001
}
Error: connect ECONNREFUSED 10.1.27.8:3001
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
Environment variable PORTAL_API_URL is not set, defaulting to http://10.1.27.8:3001/. If this is not correct, please set before starting this process.
Error: Did not receive anonymous access token.
    at Request._callback (C:\Repos\wicked.haufe.io\src\ui\routes\utils.js:337:29)
    at Request.self.callback (C:\Repos\wicked.haufe.io\src\ui\node_modules\request\request.js:185:22)
    at Request.emit (events.js:196:13)
    at Request.<anonymous> (C:\Repos\wicked.haufe.io\src\ui\node_modules\request\request.js:1161:10)
    at Request.emit (events.js:196:13)
    at IncomingMessage.<anonymous> (C:\Repos\wicked.haufe.io\src\ui\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:284:20)
    at IncomingMessage.emit (events.js:201:15)
    at endReadableNT (_stream_readable.js:1130:12)
    at processTicksAndRejections (internal/process/task_queues.js:83:17)
Error: Not Found
    at C:\Repos\wicked.haufe.io\src\ui\app.js:189:21
    at Layer.handle [as handle_request] (C:\Repos\wicked.haufe.io\src\ui\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Repos\wicked.haufe.io\src\ui\node_modules\express\lib\router\index.js:317:13)
    at C:\Repos\wicked.haufe.io\src\ui\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Repos\wicked.haufe.io\src\ui\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Repos\wicked.haufe.io\src\ui\node_modules\express\lib\router\index.js:275:10)
    at C:\Repos\wicked.haufe.io\src\ui\app.js:165:16
    at Layer.handle [as handle_request] (C:\Repos\wicked.haufe.io\src\ui\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Repos\wicked.haufe.io\src\ui\node_modules\express\lib\router\index.js:317:13)
    at C:\Repos\wicked.haufe.io\src\ui\node_modules\express\lib\router\index.js:284:7 {
  status: 404
}
DonMartin76 commented 4 years ago

Which environment are you using? Windows 10? WSL? Can you please be as specific as possible, then I will try to reproduce.

Admittedly, most of us develop on macOS, but there is me knowingly no real blockers which should prevent you from using Windows. It will be some kind of regression.

Sorry for the inconvenience, will try to reproduce as soon as I know which env you are using.

DonMartin76 commented 4 years ago

Extra question: Are you on the next branch of the repo?

Paulo-Weber commented 4 years ago

I'm running on Windows 10 Pro 64bits, not a WSL. And using the branch next.

Prior to this error, I was not being able to run the services that use npm run ..., because the windows was trying to somehow open the npm.cmd, instead of executing it. So I changed the wicked-pm2.config.js file, editing all scripts that run npm, to run a bash script that will run npm run ... So after that I got this error, I'm not sure if this one is related to another.

DonMartin76 commented 4 years ago

OK. I will need to look into this. The dev env is currently certainly not optimized for development on Windows. But not saying this must stay like that, we just haven't tried it out.

Running the wicked-cli and the wicked box works though?

DonMartin76 commented 4 years ago

Sorry for not responding - I actually had - but GitHub was stuck in some weird limbo state and never accepted my comment.

Paulo-Weber commented 4 years ago

wicked-cli and wicked box worked just fine. So it's something only on the development environment.

Paulo-Weber commented 4 years ago

@DonMartin76 Any update on this Issue?

DonMartin76 commented 4 years ago

Not yet, no, sorry. I was busy with doing the current release. I'll try to find some time in the next days, but my Windows machine is hopelessly outdated :-D

DonMartin76 commented 4 years ago

Amid this Corona thing I have finally managed to arrange for myself a Windows computer in my home office and can now look at this. Grmbl.

DonMartin76 commented 4 years ago

I have spent quite some time with this, and I am starting to think it's probably not going to work to run the development environment directly on Windows. Which bash shell have you been using? I have been trying with git bash (mingw) and got pretty far. But then I run into really bad issues.

I will give a WSL setup a try, using the docker engine from Windows via the docker sock, and use a native Ubuntu node installation instead. Let's see whether that works.

Paulo-Weber commented 4 years ago

I used the mingw as well, and I haven't tried a WSL setup.

DonMartin76 commented 4 years ago

I can now reproduce the issue, and I have some ideas what the reason is. It seems to - under certain circumstances - resolve the wrong local IP address. I get two of them, and the scripts pick the wrong one. Using WSL for now, and that works nice in the rest of the aspects. I will try to fix the IP address thing, and then update the docs to work via WSL on Windows.

DonMartin76 commented 4 years ago

Set up dev env on Windows

(I will add this to the official documentation; if you still are having issues, please respond here oor file a new issue)

NOTE: This is not yet adapted to WSL2; this still uses the "old" firs version of WSL.

DonMartin76 commented 4 years ago

In the docs now: https://github.com/Haufe-Lexware/wicked.haufe.io/blob/next/doc/development-environment.md

Closing this. Feel free to reopen or create a new issue in case you find other things.