Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Gateway container runs regardless CLI containers is not ready yet #425

Merged

Conversation

sprymiker
Copy link
Contributor

@sprymiker sprymiker commented Mar 21, 2023

Description

  • Ticket/Issue:

Problem 1. Sometimes within CI CLI container is not still ready when gateway (nginx) container starts. That makes nginx configuration invalid as proxy_pass demands immediate resolving of IP.

spryker_ci_gateway_1              /docker-entrypoint.sh ngin ...   Exit 1                                                                                            
                                                                
ubuntu@ip-172-31-20-107:~/build$ docker logs spryker_ci_gateway_1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2023/03/21 13:18:05 [emerg] 1#1: host not found in upstream "cli" in /etc/nginx/conf.d/default.conf:293
nginx: [emerg] host not found in upstream "cli" in /etc/nginx/conf.d/default.conf:293
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2023/03/21 13:18:12 [emerg] 1#1: host not found in upstream "cli" in /etc/nginx/conf.d/default.conf:293
nginx: [emerg] host not found in upstream "cli" in /etc/nginx/conf.d/default.conf:293

Problem 2. CI tests failed/interrupted without any visible reason. E.g. tests are ok but exit code non-zero.

[INIT] Creating fifo: /tmp/stdout
[INIT] Creating fifo: /tmp/stderr
[INIT] Server is running at http://0.0.0.0:9000/
[INIT] Created fifo: /tmp/stdout
[INIT] Created fifo: /tmp/stderr
(node:1) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/tmp/stdout'
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[INIT] Piping /tmp/stderr

Related resources

Change log

  • Adjusted gateway Nginx configuration in the way that resolving of proxy_pass becomes dynamic and does not require running CLI container to be valid
  • Fixed missing files error in CLI container that could lead to its termination and flickery command exit code

Checklist

  • I agree with the Code Contribution License Agreement in CONTRIBUTING.md

@sprymiker
Copy link
Contributor Author

image
Schema does work

image
Gateway is running regardless CLI is not running

@alexanderM91 alexanderM91 added bug Something isn't working ready-for-release ready for release labels Mar 22, 2023
@alexanderM91 alexanderM91 merged commit 129a942 into master Mar 22, 2023
@alexanderM91 alexanderM91 deleted the bugfix/master-cli-gateway-stops-if-cli-not-running branch March 22, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-for-release ready for release
Development

Successfully merging this pull request may close these issues.

3 participants