pantsel / konga

More than just another GUI to Kong Admin API
MIT License
4.31k stars 826 forks source link

docker image not working #72

Closed Miamoto-Musashi closed 6 years ago

Miamoto-Musashi commented 7 years ago

following your instructions i tried to run konga with docker but with no luck the installed app works greatly I receive this error

here a docker-compose to test it docker-compose.yml

error: A hook (controllers) failed to load! error:include-allattempted torequire(/app/api/controllers/RemoteStorageController.js), but an error occurred:: Details:Error: Cannot find module './lib/getProxyFromURI' at Function.Module._resolveFilename (module.js:485:15) at Function.Module._load (module.js:437:25) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/app/node_modules/googleapis/node_modules/google-auth-library/node_modules/request/request.js:24:23) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/app/node_modules/googleapis/node_modules/google-auth-library/node_modules/request/index.js:145:19) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/app/node_modules/googleapis/node_modules/google-auth-library/lib/transporters.js:19:15) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) error: A hook (orm) failed to load!

pantsel commented 7 years ago

Hi @Miamoto-Musashi , your docker-compose.yml file is ok.

One thing tho, theres no need to expose port 1338 anymore for konga. It's working on 1337 by default on both development and production and KONG_ADMIN_URL is deprecated.

Apart from that, I've tested it with konga:next, and it's working fine on my end.

No dependecies are missing.

Maybe try rebuilding it and see if the error persists?

Miamoto-Musashi commented 7 years ago

Hi, thanks for the suggestions but i have no luck with it; Just to be shure I just launch docker-compose up -d with the compose attached (see updates) I don't do any build, only vanilla image from docker hub. additional infos:

$ docker-images:
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
mongo               latest              88b7188af865        7 hours ago         358MB
pantsel/konga       next                96cae7f1f23c        46 hours ago        361MB
kong                latest              506d877085f6        11 days ago         319MB
cassandra           3                   154b919bf8ce        5 weeks ago         386MB
$ docker info
Containers: 4
 Running: 3
 Paused: 0
 Stopped: 1
Images: 4
Server Version: 17.06.0-ce-rc2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 60
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3addd840653146c90a254301d6c3a663c7fd6429
runc version: 992a5be178a62e026f4069f443c6164912adbf09
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.30-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.952GiB
Name: moby
ID: 6QTX:AI2S:3TE7:3POL:OIMR:H36R:GS2D:OYPW:DSZM:XSP6:DHQK:OSF7
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 45
 Goroutines: 57
 System Time: 2017-06-17T12:59:01.843788556Z
 EventsListeners: 2
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

the error with next tag is different:

konga        | error: Error: Cannot find module './WLValidationError'
konga        |     at Function.Module._resolveFilename (module.js:485:15)
konga        |     at Function.Module._load (module.js:437:25)
konga        |     at Module.require (module.js:513:17)
konga        |     at require (internal/module.js:11:18)
konga        |     at Object.<anonymous> (/app/node_modules/sails-hook-validation/node_modules/waterline/lib/waterline/error/index.js:8:23)
konga        |     at Module._compile (module.js:569:30)
konga        |     at Object.Module._extensions..js (module.js:580:10)
konga        |     at Module.load (module.js:503:32)
konga        |     at tryModuleLoad (module.js:466:12)
konga        |     at Function.Module._load (module.js:458:3)
konga        |     at Module.require (module.js:513:17)
konga        |     at require (internal/module.js:11:18)
konga        |     at Object.<anonymous> (/app/node_modules/sails-hook-validation/node_modules/waterline/lib/waterline/utils/normalize.js:5:16)
konga        |     at Module._compile (module.js:569:30)
konga        |     at Object.Module._extensions..js (module.js:580:10)
konga        |     at Module.load (module.js:503:32)
konga        |     at tryModuleLoad (module.js:466:12)
konga        |     at Function.Module._load (module.js:458:3)
konga        |     at Module.require (module.js:513:17)
konga        |     at require (internal/module.js:11:18)
konga        |     at Object.<anonymous> (/app/node_modules/sails-hook-validation/node_modules/waterline/lib/waterline/query/deferred.js:10:17)
konga        |     at Module._compile (module.js:569:30)
konga        |     at Object.Module._extensions..js (module.js:580:10)
konga        |     at Module.load (module.js:503:32)
Miamoto-Musashi commented 7 years ago

Updates: after after changing the config file and building from source it start the container; i think the configuration mechanism is not taking into account the environment variable passed ( DB_ADAPTER=mongo)

so the final solution for me was :

cp conifg/local_example.js config/local.js
edit     connection: process.env.DB_ADAPTER || 'mongo'
sudo npm install bower gulp sails -g
npm instal
docker build . -t pantsel/konga:mongo

than add mongo tag on the docker-compose

I found this image on docker-hub

docker pull startruk/konga

hope it helps

bye

prem911 commented 7 years ago

I m also getting the same error when installing the docker image. Can the docker image be fixed?

pantsel commented 7 years ago

@prem911 , this is an issue I cannot reproduce. That's why it is still open. The docker image is working fine on my side for pantsel/konga@latest. In fact, I just tried it out again with and without mongoDB integration.

Could you please provide more details and or logs of your use case?

prem911 commented 7 years ago

@pantsel Sorry, I forgot to update that I m running docker on windows ( community edition ). Steps :

  1. https://github.com/pantsel/konga/blob/master/README.md#production-docker-image Ran the above command in powershell. The container logs immediately spits out Error: Cannot find module './WLValidationError' at Function.Module._resolveFilename (module.js:485:15) at Function.Module._load (module.js:437:25) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object. (/app/node_modules/sails-hook-validation/node_modules/waterline/lib/waterline/error/index.js:8:23)
pantsel commented 7 years ago

This is what i get


                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

Start interactive shell

Administrator@dev16 MINGW64 ~
$ docker run -p 1337:1337 \
>              --name konga \
>              -e "NODE_ENV=production" \
>              pantsel/konga
time="2017-07-03T14:09:58+03:00" level=info msg="Unable to use system certificat
e pool: crypto/x509: system root pool is not available on Windows"
The default `sails-disk` adapter is not designed for use as a production databas
e;
(it stores the entire contents of your database in memory)
Instead, please use another adapter; e.g. sails-postgresql or sails-mongo.
For more info, see: http://sailsjs.org/documentation/concepts/deployment
To hide this warning message, enable `sails.config.orm.skipProductionWarnings`.
Hook:api_health_checks:process() called
Hook:health_checks:process() called
Hook:user_events_hook:process() called
Seeding User...
User seed planted
Seeding Kongnode...
Kongnode seed planted
Seeding Emailtransport...
Emailtransport seed planted

               .-..-.

   Sails              <|    .-..-.
   v0.12.13            |\
                      /|.\
                     / || \
                   ,'  |'  \
                .-'.-==|/_--'
                `--'-------'
   __---___--___---___--___---___--___
 ____---___--___---___--___---___--___-__

Server lifted in `/app`
To see your app, visit http://localhost:1337
To shut down Sails, press  + C at any time.

-------------------------------------------------------
:: Mon Jul 03 2017 11:10:00 GMT+0000 (UTC)
Environment : production
Port        : 1337
-------------------------------------------------------

prem911 commented 7 years ago

Used Kitematic too, but same errors. image

pantsel commented 7 years ago

I just published v0.8.1 in which i updated some dependecies. Try pulling the new version from docker in a while just in case.

I'll be waiting for feedback.

prem911 commented 7 years ago

Issue still persists :( image

prem911 commented 7 years ago

I built the image and then docker run worked fine. However, I m unable to configure the local kong admin url

pantsel commented 7 years ago

Kong admin url is deprecated. Theres no need to configure it.

prem911 commented 7 years ago

Yes saw the default connection created in Connections tab. However it was not enabled and wasnot intuitive to make it active. After a bit of trial and error, got it working. image

mrgavinconway001 commented 7 years ago

Seeing the same issue here with versions 0.8.1 and :next .

Digest: sha256:03b19cba5f34bff8f2abf724bd25fcf9acd7a50bd8f883a004362c1ef49ac3f8 Status: Downloaded newer image for pantsel/konga:next 5c26acafaf0271160d37e9e12d1a2f61ea9fefa3ca6fa24c465e9b9471b77d7b error: Error: Cannot find module './WLValidationError' at Function.Module._resolveFilename (module.js:485:15) at Function.Module._load (module.js:437:25) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/app/node_modules/sails-hook-validation/node_modules/waterline/lib/waterline/error/index.js:8:23) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/app/node_modules/sails-hook-validation/node_modules/waterline/lib/waterline/utils/normalize.js:5:16) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/app/node_modules/sails-hook-validation/node_modules/waterline/lib/waterline/query/deferred.js:10:17) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/app/node_modules/sails-hook-validation/lib/create.js:5:16) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3)

kewubenduben commented 7 years ago

I am now once again encountering this. Could this be a result of a docker image rebuild? I have been using 0.8.1 fine until earlier where 0.8.3 is released.

kewubenduben commented 7 years ago

@pantsel, bumping this.

I am now once again encountering this. Could this be a result of a docker image rebuild? I have been using 0.8.1 fine until earlier where 0.8.3 is released.
pantsel commented 7 years ago

@thecantero , I really don't have a clue as this is an issue I cannot reproduce no matter what I do.

I'm using the 0.8.3 docker image in production as we speak + it is also deployed with no problems on the demo instance as well.

That error states that the module './WLValidationError' cannot be found which indicates that somehow the files are not there?

That surely can't be the case because we're all using the same pre-built image.

I can't figure out why it works for me on all my environments and not for you.

Does the problem persists if you completely remove the container and image and install it again from scratch?

cyberious commented 7 years ago

I am sure if this is related, but I am getting Neat! Your account is activated. when deploying into my Kubernetes cluster with nothing else, no css be handled through it or any javascript being loaded.

cyberious commented 7 years ago

I redact my statement, Chrome caching css failed me. Wasn't properly reloading.

Miamoto-Musashi commented 6 years ago

with latest version the bug is solved from my side, for me you can close it thanks have a great day

pantsel commented 6 years ago

@Miamoto-Musashi , cheers!