Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Missing packages.json #214

Open
garygan89 opened this issue Dec 19, 2022 · 3 comments
Open

Missing packages.json #214

garygan89 opened this issue Dec 19, 2022 · 3 comments

Comments

@garygan89
Copy link

garygan89 commented Dec 19, 2022

When trying to deploy it via kubernetes option using yarn, its missing the packages.json file.

Currently the way I deploy to a bare metal k8s cluster is by cd to the main folder under each infrastructure package, then execute k8s.sh. Will submit a merge request since some require fixes.

@phb95
Copy link

phb95 commented Apr 6, 2023

I am also stuck with the yarn error message error Couldn't find a package.json file in ....

I'm using minikube, will try the scripts as you did.

Thanks for the issue.

@phb95
Copy link

phb95 commented Apr 18, 2023

I'm posting this here as a follow up, but I can create a separate issue if you wish.

When using the k8s.sh init in core/kubernetes/main, the openhim-core fails to start :

# kubectl get pods
NAME                                           READY   STATUS             RESTARTS      AGE
hapi-fhir-mysql-deployment-8fd6db585-jjgmr     1/1     Running            0             2m37s
hapi-fhir-server-deployment-58bd547dfc-7gzhf   1/1     Running            0             2m37s
mongo-0                                        1/1     Running            0             5m7s
mongo-1                                        1/1     Running            0             5m5s
mongo-2                                        1/1     Running            0             5m3s
openhim-config-importer-job-lt9vk              0/1     Init:0/1           0             2m36s
openhim-console-deployment-f5567dd89-gfl5s     0/1     Init:0/1           0             2m36s
openhim-console-deployment-f5567dd89-rthbt     0/1     Init:0/1           0             2m36s
openhim-core-deployment-7bc75bcc5f-82m6n       0/1     CrashLoopBackOff   4 (63s ago)   2m37s
openhim-core-deployment-7bc75bcc5f-b5qnr       0/1     CrashLoopBackOff   4 (60s ago)   2m37s

# kubectl logs openhim-core-deployment-7bc75bcc5f-82m6n
Defaulted container "openhim-core" out of: openhim-core, check-mongo-status (init)
[winston] Attempt to write logs with no transports {"message":"No config found for env production at path /usr/src/app/config/production.json","level":"warn"}
/usr/src/app/lib/config/connection.js:24
const connectionAgenda = _mongoose.default.createConnection(encodeMongoURI(_.config.mongo.url));
                                                                                          ^

TypeError: Cannot read property 'url' of undefined
    at Object.<anonymous> (/usr/src/app/lib/config/connection.js:24:91)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/usr/src/app/lib/config/index.js:20:19)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/usr/src/app/lib/model/contactGroups.js:10:15)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)

Looks like another missing file.

@garygan89 you mentioned some file needing fixes, did you encounter this one ?

@phb95
Copy link

phb95 commented Apr 18, 2023

Solved this one after noticing the presence of a core-openhim-core-volume mounted at /usr/src/app/config containing a development.json but no production.json.

After copying kubernetes/main/openhim/volume/openhim-core/development.json to kubernetes/main/openhim/volume/openhim-core/production.json and adding it to the description:

diff --git a/core/kubernetes/main/kustomization.yaml b/core/kubernetes/main/kustomization.yaml
index 0e92fe1..31bab55 100644
--- a/core/kubernetes/main/kustomization.yaml
+++ b/core/kubernetes/main/kustomization.yaml
@@ -2,6 +2,7 @@ configMapGenerator:
   - name: core-openhim-core-configmap
     files:
       - ./openhim/volume/openhim-core/development.json
+      - ./openhim/volume/openhim-core/production.json
   - name: core-hapi-fhir-mysql-configmap
     files:
       - ./hapi-fhir/volume/mysql.cnf

openhim-core starts.

Will go on exploring from there, please let me know if this is a valid solution.

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

No branches or pull requests

2 participants