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

kong-att: Source 42-kong-envs.sh #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dcarley
Copy link

@dcarley dcarley commented Dec 5, 2022

So that the --yml argument can be used with --tag in addition to --image. Images created from tags, with Kong built from make dev, don't have the kong binary on the default PATH and other Lua environment variables set for non-interactive shells. This results in the following error:

kong-3-0-0-kong-1   | /bin/kong-att: 7: /bin/kong-att: kong: not found
kong-3-0-0-kong-1   | ln: failed to create symbolic link '/kong/servroot/logs/access.log': No such file or directory
kong-3-0-0-kong-1   | ln: failed to create symbolic link '/kong/servroot/logs/admin_access.log': No such file or directory
kong-3-0-0-kong-1   | ln: failed to create symbolic link '/kong/servroot/logs/error.log': No such file or directory
kong-3-0-0-kong-1   | nginx: [alert] could not open error log file: open() "/kong/servroot/logs/error.log" failed (2: No such file or directory)
kong-3-0-0-kong-1   | 2022/12/04 21:58:57 [emerg] 1#0: open() "/kong/servroot/nginx.conf" failed (2: No such file or directory)
kong-3-0-0-kong-1 exited with code 1

It can be reproduced with this kong.yml:

version: '3.5'
services:
  kong:
    ports:
      - 8000:8000
      - 8001:8001

And these commands to build a new image:

gojira up --tag 3.0.0
gojira run --tag 3.0.0 make dev 
gojira up --tag 3.0.0 --yml kong.yaml

@CLAassistant
Copy link

CLAassistant commented Dec 5, 2022

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hanshuebner
Copy link
Contributor

I have reproduced the issue, but the patch does not seem to fix it. Can you try again yourself, deleting all docker images before you rebuild?

So that the `--yml` argument can be used with `--tag` in addition to
`--image`. Images created from tags, with Kong built from `make dev`,
don't have the `kong` binary on the default `PATH` and other Lua
environment variables set for non-interactive shells. This results in
the following error:

    kong-3-0-0-kong-1   | /bin/kong-att: 7: /bin/kong-att: kong: not found
    kong-3-0-0-kong-1   | ln: failed to create symbolic link '/kong/servroot/logs/access.log': No such file or directory
    kong-3-0-0-kong-1   | ln: failed to create symbolic link '/kong/servroot/logs/admin_access.log': No such file or directory
    kong-3-0-0-kong-1   | ln: failed to create symbolic link '/kong/servroot/logs/error.log': No such file or directory
    kong-3-0-0-kong-1   | nginx: [alert] could not open error log file: open() "/kong/servroot/logs/error.log" failed (2: No such file or directory)
    kong-3-0-0-kong-1   | 2022/12/04 21:58:57 [emerg] 1#0: open() "/kong/servroot/nginx.conf" failed (2: No such file or directory)
    kong-3-0-0-kong-1 exited with code 1

It can be reproduced with this `kong.yml`:

    _format_version: "2.1"
    _transform: true

    services:
    - name: httpbin
      url: http://httpbin:80
      routes:
      - name: httpbin
        paths:
        - /

And these commands to build a new image:

    gojira up --tag 3.0.0
    gojira run --tag 3.0.0 make dev
    gojira snapshot --tag 3.0.0
    gojira up --tag 3.0.0 --yml kong.yaml

The same steps should work, after deleting all Docker images/layers,
when running from this branch/commit.
@dcarley
Copy link
Author

dcarley commented Dec 14, 2022

Thanks for testing the patch. I assume that I got a dependency error like this?

kong-3-1-0-kong-1   | ERROR: ./kong/globalpatches.lua:84: module 'resty.timerng' not found:No LuaRocks module found for resty.timerng

I think that I must have taken a manual snapshot after running make dev or forgotten about enabling GOJIRA_MAGIC_DEV. Without either of those, the artifacts from make dev are lost when the container is recreated by gojira up, which is the same behaviour if you run make dev and then gojira down without using the --yml argument. I'm thinking that's outside the scope of this PR.

I've adjusted the commands in the PR description and also corrected the kong.yaml file which should have been a Kong declarative config rather than a Gojira egg (which I was also using but doesn't appear to affect the behaviour). Apologies for the confusion.

As a sidenote, I originally thought about it when opening this PR but it's even more relevant now, it would be great to setup some CI tests for common workflows. Is that of interest? Would an initial PR be accepted if a maintainer does the remaining setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants