b-rajesh / diy-nginx-plus-api-gateway

An opinionated way of building nginx plus as apigateway. Aimed to reduce & simplify the api onboarding
7 stars 6 forks source link

Error while building the image #1

Open smedava2 opened 3 years ago

smedava2 commented 3 years ago

Hi Rajesh,

Thank you for the clear instructions on the Nginx plus concept. I am installing Nginx plus for the first time. I am trying to build the image but i see this issue. Anything i am missing thats giving me this error?

9 45.41 Unpacking nginx-plus (23-2~stretch) ...

9 46.26 Setting up nginx-plus (23-2~stretch) ...

9 46.44 invoke-rc.d: could not determine current runlevel

9 46.45 invoke-rc.d: policy-rc.d denied execution of start.

9 46.95 + apt-get remove --purge --auto-remove -y gnupg1

9 46.98 Reading package lists...

9 48.66 Building dependency tree...

9 48.97 Reading state information...

9 49.31 The following packages will be REMOVED:

9 49.31 gnupg1 libreadline7 readline-common*

9 49.59 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.

9 49.59 After this operation, 1935 kB disk space will be freed.

(Reading database ... 6950 files and directories currently installed.)

9 49.63 Removing gnupg1 (1.4.21-4+deb9u1) ...

9 49.73 Removing libreadline7:amd64 (7.0-3) ...

9 49.84 Removing readline-common (7.0-3) ...

9 49.95 Processing triggers for libc-bin (2.24-11+deb9u4) ...

(Reading database ... 6896 files and directories currently installed.)

9 50.09 Purging configuration files for readline-common (7.0-3) ...

9 50.28 + apt-get install -y nginx-plus-module-njs

9 50.31 Reading package lists...

9 51.70 Building dependency tree...

9 51.91 Reading state information...

9 52.01 Some packages could not be installed. This may mean that you have

9 52.01 requested an impossible situation or if you are using the unstable

9 52.01 distribution that some required packages have not yet been created

9 52.01 or been moved out of Incoming.

9 52.01 The following information may help to resolve the situation:

9 52.01

9 52.01 The following packages have unmet dependencies:

9 52.17 nginx-plus-module-njs : Depends: nginx-plus-r24 but it is not installable

9 52.25 E: Unable to correct problems, you have held broken packages.


executor failed running [/bin/sh -c set -x && apt-get update && apt-get upgrade -y && apt-get install --no-install-recommends --no-install-suggests -y apt-transport-https ca-certificates gnupg1 && NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; found=''; for server in ha.pool.sks-keyservers.net hkp://keyserver.ubuntu.com:80 hkp://p80.pool.sks-keyservers.net:80 pgp.mit.edu ; do echo "Fetching GPG key $NGINX_GPGKEY from $server"; apt-key adv --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$NGINX_GPGKEY" && found=yes && break; done; test -z "$found" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1; echo "Acquire::https::plus-pkgs.nginx.com::Verify-Peer \"true\";" >> /etc/apt/apt.conf.d/90nginx && echo "Acquire::https::plus-pkgs.nginx.com::Verify-Host \"true\";" >> /etc/apt/apt.conf.d/90nginx && echo "Acquire::https::plus-pkgs.nginx.com::SslCert \"/etc/ssl/nginx/nginx-repo.crt\";" >> /etc/apt/apt.conf.d/90nginx && echo "Acquire::https::plus-pkgs.nginx.com::SslKey \"/etc/ssl/nginx/nginx-repo.key\";" >> /etc/apt/apt.conf.d/90nginx && printf "deb https://plus-pkgs.nginx.com/debian stretch nginx-plus\n" > /etc/apt/sources.list.d/nginx-plus.list && apt-get update && apt-get install -y nginx-plus && apt-get remove --purge --auto-remove -y gnupg1 && apt-get install -y nginx-plus-module-njs && apt-get install -y nginx-plus-module-opentracing && apt-get install nginx-plus-module-headers-more && rm /etc/nginx/conf.d/default.conf && apt-get install -y jq && rm -rf /var/lib/apt/lists/* && rm -rf /etc/ssl/nginx]: exit code: 100

I really appreciate any help on this.

Thanks! ~Swetha

b-rajesh commented 3 years ago

Hi @smedava2 Apologies for the delay. now it should work. updated the docker instruction with latest ubuntu image let me know if that helps

smedava2 commented 3 years ago

Thank you!! Installation worked smoothly. I am using your hello-f1 service to test out the nginx plus gateway. I am able to access it through the 3000 port but when i try it out using nginx plus I am getting a 404 with no helpful information in the logs. I don't think I missed any steps I have followed the steps in the git as well as the Show Code Episode 1 video. Not sure how to debug this to understand where the problem is.

Thanks! ~Swetha

b-rajesh commented 3 years ago

Hi Swetha, since you are running docker , within nginx plus it needs to know what is the hello-f1 service endpoint. While packaging the nginx config, you could specify the upstream endpoint for hello-f1 as your local machine ip address to make it work. Eventually update the instruction for the same

Thank you Rajesh