Haufe-Lexware / wicked.haufe.io

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

Error building development environment on Linux #252

Closed Alexanderdorow closed 4 years ago

Alexanderdorow commented 4 years ago

I'm trying to build my development environment, but when I execute the ./build-kong script the current error happens:

Building kong Step 1/15 : FROM kong:0.14.1-centos ---> 82c319fe323d Step 2/15 : ENV KONG_PG_HOST kong-database ---> Using cache ---> 0f4cd7003643 Step 3/15 : ENV KONG_PG_USER kong ---> Using cache ---> 17ca21affcdb Step 4/15 : ENV KONG_PG_PASSWORD kong ---> Using cache ---> 331bd41b0963 Step 5/15 : ENV KONG_DATABASE postgres ---> Using cache ---> 1fd4c248b459 Step 6/15 : ENV KONG_ADMIN_ACCESS_LOG "/tmp/stdout" ---> Using cache ---> c4bdbe194cc2 Step 7/15 : ENV KONG_ADMIN_ERROR_LOG "/tmp/stderr" ---> Using cache ---> 582a26af0c12 Step 8/15 : ENV KONG_PROXY_ACCESS_LOG "/tmp/stdout" ---> Using cache ---> 9622df862867 Step 9/15 : ENV KONG_PROXY_ERROR_LOG "/tmp/stderr" ---> Using cache ---> 886553a62483 Step 10/15 : RUN yum install -y epel-release && yum install -y wget && yum clean all && wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 && chmod +x /usr/local/bin/dumb-init && wget -O /usr/local/bin/wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/55c54a5abdfb32637b563b28cc088314b162195e/wait-for-it.sh && chmod +x /usr/local/bin/wait-for-it.sh && mkdir -p /usr/src/app ---> Using cache ---> 5cfea5d22fda Step 11/15 : RUN ln -sf /proc/1/fd/1 /tmp/stdout && ln -sf /proc/1/fd/2 /tmp/stderr ---> Using cache ---> d69a88af8444 Step 12/15 : COPY templates/nginx_kong.lua /root/nginx_kong.lua ---> Using cache ---> e332cbc1fa9e Step 13/15 : COPY startup.sh /startup.sh ---> Using cache ---> b4732295e66d Step 14/15 : COPY git_* /usr/src/app/ ERROR: Service 'kong' failed to build: COPY failed: no source files were specified If you remove the line COPY git_ / usr / src / app / * from the kong's DockerFile, everything will work, however I came across that kong with no route.

Logs from UI application: 2|ui | debug: [+ 1ms] portal:utils createAnonymousTokenInternal() 2|ui | debug: [+ 0ms] portal:utils getAccessToken() - using token URL: http://10.1.27.43:8000/auth/local/api/portal-api/token 2|ui | debug: [+ 1ms] portal:utils {"message":"no route and no API found with those values"} 2|ui | error: [+ 0ms] portal:utils ERROR: Did not receive expected access_token. 2|ui | error: [+ 1ms] portal:app {} 2|ui | Error: Did not receive anonymous access token. 2|ui | at Request._callback (/home/alexander/projects/wicked.haufe.io/src/ui/routes/utils.js:336:29) 2|ui | at Request.self.callback (/home/alexander/projects/wicked.haufe.io/src/ui/node_modules/request/request.js:185:22) 2|ui | at Request.emit (events.js:223:5) 2|ui | at Request.<anonymous> (/home/alexander/projects/wicked.haufe.io/src/ui/node_modules/request/request.js:1161:10) 2|ui | at Request.emit (events.js:223:5) 2|ui | at IncomingMessage.<anonymous> (/home/alexander/projects/wicked.haufe.io/src/ui/node_modules/request/request.js:1083:12) 2|ui | at Object.onceWrapper (events.js:312:28) 2|ui | at IncomingMessage.emit (events.js:228:7) 2|ui | at endReadableNT (_stream_readable.js:1185:12) 2|ui | at processTicksAndRejections (internal/process/task_queues.js:81:21)

Kong: http://10.1.27.43:8000/auth/local/api/portal-api/token Response: {"message":"no route and no API found with those values"} Versions: Npm: 6.13.4 Node: v12.14.1 Ubuntu: 18.04 Docker: 19.03.5, build 633a0ea838

DonMartin76 commented 4 years ago

OK, will see if I can give this a try on a Ubuntu machine to find out what the issue may be.

DonMartin76 commented 4 years ago

Can reproduce; this happens on fresh installations where you never have run build.sh (which shouldn't, by design, be necessary). As a workaround, please run ./build.sh from the src directory once, and you should be able to follow the rest of the development environment setup again.

This I just tested both on macOS and on Ubuntu 18.04, and it seems to work alright.

Sorry for the inconvenience, hoping I will be able to address this very soon; it shouldn't be too hard to fix.

Alexanderdorow commented 4 years ago

The build is fixed, tnx! But now I'm facing an issue with kong routes, the portal can't get the anonymous access token, I think that's because kong is without any route.

image

DonMartin76 commented 4 years ago

But now I'm facing an issue with kong routes, the portal can't get the anonymous access token, I think that's because kong is without any route.

If Kong is without routes, that means that the Kong Adapter is not working correctly. Can you check the logs with pm2 logs kong-adapter and see what it says?

Alexanderdorow commented 4 years ago
[TAILING] Tailing last 15 lines for [kong-adapter] process (change the value with --lines option)
/home/alexander/.pm2/logs/kong-adapter-error.log last 15 lines:
3|kong-ada | npm ERR!     /home/alexander/.npm/_logs/2020-02-04T15_40_38_531Z-debug.log
3|kong-ada | npm ERR! code ELIFECYCLE
3|kong-ada | npm ERR! errno 2
3|kong-ada | npm ERR! portal-kong-adapter@1.0.0-rc.12 build-and-start: `./build-typescript.sh && node ./dist/bin/kong-adapter.js`
3|kong-ada | npm ERR! Exit status 2
3|kong-ada | npm ERR! 
3|kong-ada | npm ERR! Failed at the portal-kong-adapter@1.0.0-rc.12 build-and-start script.
3|kong-ada | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3|kong-ada | 
3|kong-ada | npm ERR! A complete log of this run can be found in:
3|kong-ada | npm ERR!     /home/alexander/.npm/_logs/2020-02-04T15_40_41_675Z-debug.log
3|kong-ada | Environment variable PORTAL_API_URL is not set, defaulting to http://10.1.27.43:3001/. If this is not correct, please set before starting this process.
3|kong-ada | Environment variable PORTAL_API_URL is not set, defaulting to http://10.1.27.43:3001/. If this is not correct, please set before starting this process.
3|kong-ada | Environment variable PORTAL_API_URL is not set, defaulting to http://10.1.27.43:3001/. If this is not correct, please set before starting this process.
3|kong-ada | Environment variable PORTAL_API_URL is not set, defaulting to http://10.1.27.43:3001/. If this is not correct, please set before starting this process.

/home/alexander/.pm2/logs/kong-adapter-out.log last 15 lines:
3|kong-ada | info: [+   1ms] kong-adapter:monitor           Monitor: Kong is answering.
3|kong-ada | debug: [+9996ms] kong-adapter:monitor           pingKong()
3|kong-ada | debug: [+   1ms] kong-adapter:utils             kongAction(): GET ""
3|kong-ada | debug: [+   7ms] kong-adapter:utils             kongAction(): GET "status"
3|kong-ada | info: [+   5ms] kong-adapter:monitor           Monitor: Kong is answering.
3|kong-ada | debug: [+9988ms] kong-adapter:monitor           pingKong()
3|kong-ada | debug: [+   0ms] kong-adapter:utils             kongAction(): GET ""
3|kong-ada | debug: [+   6ms] kong-adapter:utils             kongAction(): GET "status"
3|kong-ada | info: [+   4ms] kong-adapter:monitor           Monitor: Kong is answering.
3|kong-ada | debug: [+6442ms] kong-adapter:app               /ping
3|kong-ada | {"date":"2020-02-04T15:52:45.801Z","method":"GET","url":"/ping","remote-addr":"::ffff:10.1.27.43","version":"1.1","status":"200","content-length":"532","referrer":"-","response-time":"0.263","correlation-id":"c959db31-9001-4437-b0ca-88c063544368"}
3|kong-ada | debug: [+3548ms] kong-adapter:monitor           pingKong()
3|kong-ada | debug: [+   0ms] kong-adapter:utils             kongAction(): GET ""
3|kong-ada | debug: [+   3ms] kong-adapter:utils             kongAction(): GET "status"
3|kong-ada | info: [+   2ms] kong-adapter:monitor           Monitor: Kong is answering.

3|kong-adapter  | debug: [+9995ms] kong-adapter:monitor           pingKong()
3|kong-adapter  | debug: [+   0ms] kong-adapter:utils             kongAction(): GET ""
3|kong-adapter  | debug: [+   3ms] kong-adapter:utils             kongAction(): GET "status"
3|kong-adapter  | info: [+   1ms] kong-adapter:monitor           Monitor: Kong is answering.
Alexanderdorow commented 4 years ago

I resolved! I just do "npm install" in all the repository folders and work it! Tnx for all the help!!

DonMartin76 commented 4 years ago

Okay? The ./install.sh script in /src/tools/development should do exactly that? Did you use that?

Alexanderdorow commented 4 years ago

I used, but I don't remember if a used in sudo or not.

DonMartin76 commented 4 years ago

Sudo should absolutely not be necessary.

Alexander Dorow notifications@github.com schrieb am Di. 4. Feb. 2020 um 17:43:

I used, but I don't remember if a used in sudo or not.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Haufe-Lexware/wicked.haufe.io/issues/252?email_source=notifications&email_token=ABX4ZI6RUMTN7C2GR34P3KLRBGLJ7A5CNFSM4KPWRQ62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKYKGLA#issuecomment-582001452, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABX4ZI4C4JDXVPKOJPBZJHLRBGLJ7ANCNFSM4KPWRQ6Q .