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

make: ci recipe fails at setup #195

Closed
dprelipcean opened this issue Sep 6, 2019 · 3 comments
Closed

make: ci recipe fails at setup #195

dprelipcean opened this issue Sep 6, 2019 · 3 comments

Comments

@dprelipcean
Copy link
Contributor

dprelipcean commented Sep 6, 2019

What happens

I wanted to run in dev mode, hence I used

$ CLUSTER_CONFIG=dev make ci

The recipe went through without problems; however, when trying to set up my environment:

$ eval $(reana-dev setup-environment)
ERROR:  relation "user_" does not exist
LINE 1: SELECT access_token FROM user_
                                 ^
command terminated with exit code 1
Environment variables could not be generated: 
Command '['kubectl', 'exec', '-t', 'db-7df68b647-vnb4v', '--', 'psql', '-U', 'reana', 'reana', '-c', 'SELECT access_token FROM user_']' returned non-zero exit status 1.

Here is where the error is produced.

When running it normally, i.e. simply make ci, everything works as expected.

More info

Looking at my pods, the server pod actually fails:

$ kubectl get pods
NAME                                                   READY   STATUS             RESTARTS   AGE
cache-f74dd5fd8-jzvpk                                  1/1     Running            0          86m
db-7df68b647-7jj4h                                     1/1     Running            0          86m
message-broker-6758d6f768-sd76w                        1/1     Running            0          86m
my-shell-6d9885f5df-l2pww                              1/1     Running            1          168m
server-59bdf5b75b-4g26v                                0/2     CrashLoopBackOff   42         86m
wdb-6c44658878-cmz4q                                   1/1     Running            0          86m
workflow-controller-bf974dd-dq6fj                      2/2     Running            0          86m

Looking at the logs:

$ kubectl logs server-59bdf5b75b-4g26v  server
Creating REANA database ...
/usr/local/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py:835: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.
  'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '

/usr/local/lib/python3.6/site-packages/invenio_config/default.py:74: UserWarning: Set configuration variable SECRET_KEY with random string
  UserWarning)

/usr/local/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py:835: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.
  'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '

Usage: invenio [OPTIONS] COMMAND [ARGS]...
Try "invenio --help" for help.

Error: No such command "reana-db".

and

$ kubectl logs server-59bdf5b75b-4g26v  scheduler
/usr/local/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py:835: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.
  'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '
2019-09-06 11:41:52,037 | passlib.registry | MainThread | DEBUG | registered 'invenio_aes_encrypted_email' handler: <class 'invenio_accounts.hash.InvenioAesEncryptedEmail'>
2019-09-06 11:41:52,071 | passlib.registry | MainThread | DEBUG | registered 'pbkdf2_sha512' handler: <class 'passlib.handlers.pbkdf2.pbkdf2_sha512'>
2019-09-06 11:41:52,075 | passlib.registry | MainThread | DEBUG | registered 'sha256_crypt' handler: <class 'passlib.handlers.sha2_crypt.sha256_crypt'>
2019-09-06 11:41:52,078 | passlib.registry | MainThread | DEBUG | registered 'hex_md5' handler: <class 'passlib.handlers.digests.hex_md5'>
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try "flask --help" for help.

Error: No such command "start-scheduler".

with

$ kubectl describe pod server-59bdf5b75b-4g26v
Name:           server-59bdf5b75b-4g26v
Namespace:      default
Priority:       0
Node:           minikube/192.168.122.240
Start Time:     Fri, 06 Sep 2019 12:17:46 +0200
Labels:         app=server
                pod-template-hash=59bdf5b75b
Annotations:    <none>
Status:         Running
IP:             172.17.0.7
Controlled By:  ReplicaSet/server-59bdf5b75b
Containers:
  server:
    Container ID:  docker://b39de5b315b452350f461cbebc225194d129c770a23c2322c24fe252abff357a
    Image:         reanahub/reana-server:latest
    Image ID:      docker://sha256:0fbc333f172f1f3e32d9ca24e236adf1dd154968cee78ce81708641b9f2733cd
    Port:          5000/TCP
    Host Port:     0/TCP
    Command:
      /bin/sh
      -c
    Args:
      set -e; ./scripts/setup; invenio run -h 0.0.0.0 -p 5000
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    2
      Started:      Fri, 06 Sep 2019 13:41:48 +0200
      Finished:     Fri, 06 Sep 2019 13:41:53 +0200
    Ready:          False
    Restart Count:  21
    Environment:
      REANA_DB_PORT:             5432
      REANA_DB_HOST:             db
      REANA_DB_PASSWORD:         reana
      REANA_DB_USERNAME:         reana
      REANA_DB_NAME:             reana
      SHARED_VOLUME_PATH:        /var/reana
      WDB_SOCKET_SERVER:         wdb
      WDB_NO_BROWSER_AUTO_OPEN:  True
      FLASK_ENV:                 development
    Mounts:
      /code from reana-server-code (rw)
      /var/reana from reana-shared-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-qhv2v (ro)
  scheduler:
    Container ID:  docker://47837302dc26e529e9806abd5106052beab01247a11f941560bc3f3630616f82
    Image:         reanahub/reana-server:latest
    Image ID:      docker://sha256:0fbc333f172f1f3e32d9ca24e236adf1dd154968cee78ce81708641b9f2733cd
    Port:          <none>
    Host Port:     <none>
    Command:
      flask
      start-scheduler
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    2
      Started:      Fri, 06 Sep 2019 13:41:48 +0200
      Finished:     Fri, 06 Sep 2019 13:41:53 +0200
    Ready:          False
    Restart Count:  21
    Environment:
      REANA_DB_PORT:             5432
      REANA_DB_HOST:             db
      REANA_DB_PASSWORD:         reana
      REANA_DB_USERNAME:         reana
      REANA_DB_NAME:             reana
      SHARED_VOLUME_PATH:        /var/reana
      WDB_SOCKET_SERVER:         wdb
      WDB_NO_BROWSER_AUTO_OPEN:  True
      FLASK_ENV:                 development
    Mounts:
      /code from reana-server-code (rw)
      /var/reana from reana-shared-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-qhv2v (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  reana-shared-volume:
    Type:          HostPath (bare host directory volume)
    Path:          /var/reana
    HostPathType:  
  reana-server-code:
    Type:          HostPath (bare host directory volume)
    Path:          /code/reana-server
    HostPathType:  
  default-token-qhv2v:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-qhv2v
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason   Age                    From               Message
  ----     ------   ----                   ----               -------
  Warning  BackOff  6m53s (x381 over 86m)  kubelet, minikube  Back-off restarting failed container
  Warning  BackOff  108s (x406 over 86m)   kubelet, minikube  Back-off restarting failed container

@diegodelemos I see that invenio has something to deal with this, maybe it's related to the recent updates?

@dprelipcean dprelipcean added this to To do in Physics-Examples-Summer-2019 via automation Sep 6, 2019
@diegodelemos
Copy link
Member

tl;dr

Can you try with reana-dev git-clean -c CLUSTER and run it again?

Explanation

This sounds like the problem described in reanahub/reana-workflow-controller#64, to which Tibor proposed a solution (reanahub/reana-workflow-controller#64 (comment)), and later was integrated into reana-dev command as reana-dev git-clean, see the docs https://reana.readthedocs.io/en/latest/developerguide.html.

@diegodelemos
Copy link
Member

You will need to install the reana-server package in your local machine:

(reana-server) ~/src/reana-server $ pip install -e .
...

The reason is that the editable mode creates and uses the egg-info (therefore expects it to exist) to save you from reinstalling the application after every code change. Then what happens is that the .eggs-info is not there, because REANA-Server was never installed in your computer or because you run git clean ... and when the application looks for the entrypoint to resolve the reana-db command, the reana-server.eggs-info/entry_points.txt is not there.

@tiborsimko
Copy link
Member

N.B. The fix was merged in #198.

Physics-Examples-Summer-2019 automation moved this from To do to Done Sep 20, 2019
mdonadoni added a commit to mdonadoni/reana that referenced this issue Mar 5, 2024
chore(reana-ui/master): release 0.9.4

build(reana-ui/package): update yarn.lock (reanahub#399)

build(reana-ui/package): require jsroot<7.6.0 (reanahub#399)

ci(reana-ui/commitlint): allow release commit style (reanahub#400)

docs(reana-ui/authors): complete list of contributors (reanahub#396)

ci(reana-ui/shellcheck): exclude node_modules from the analyzed paths (reanahub#387)

fix(reana-ui/progress): update failed workflows duration using finish time (reanahub#387)

feat(reana-ui/footer): link privacy notice to configured URL (reanahub#393)

refactor(reana-ui/docs): move from reST to Markdown (reanahub#391)

ci(reana-ui/commitlint): check for the presence of concrete PR number (reanahub#390)

ci(reana-ui/shellcheck): fix exit code propagation (reanahub#390)

fix(reana-ui/launcher): remove dollar sign in generated Markdown (reanahub#389)

ci(reana-ui/release-please): update version in package.json and Dockerfile (reanahub#385)

ci(reana-ui/release-please): switch to `simple` release strategy (reanahub#383)

fix(reana-ui/router): show 404 page for invalid URLs (reanahub#382)

ci(reana-ui/release-please): initial configuration (reanahub#380)

ci(reana-ui/commitlint): addition of commit message linter (reanahub#380)

chore(reana-message-broker/master): release 0.9.3

ci(reana-message-broker/commitlint): allow release commit style (reanahub#67)

docs(reana-message-broker/authors): complete list of contributors (reanahub#66)

refactor(reana-message-broker/docs): move from reST to Markdown (reanahub#65)

ci(reana-message-broker/commitlint): check for the presence of concrete PR number (reanahub#64)

ci(reana-message-broker/shellcheck): fix exit code propagation (reanahub#64)

ci(reana-message-broker/release-please): update version in Dockerfile (reanahub#63)

fix(reana-message-broker/startup): handle signals for graceful shutdown (reanahub#59)

ci(reana-message-broker/release-please): initial configuration (reanahub#60)

ci(reana-message-broker/commitlint): addition of commit message linter (reanahub#60)

chore(reana-server/master): release 0.9.3

build(reana-server/python): bump all required packages as of 2024-03-04 (reanahub#674)

build(reana-server/python): bump shared REANA packages as of 2024-03-04 (reanahub#674)

build(reana-server/python): bump shared modules (reanahub#676)

ci(reana-server/commitlint): allow release commit style (reanahub#675)

docs(reana-server/authors): complete list of contributors (reanahub#673)

ci(reana-server/pytest): move to PostgreSQL 14.10 (reanahub#672)

refactor(reana-server/docs): move from reST to Markdown (reanahub#671)

style(reana-server/black): format with black v24 (reanahub#670)

ci(reana-server/commitlint): check for the presence of concrete PR number (reanahub#669)

ci(reana-server/shellcheck): fix exit code propagation (reanahub#669)

ci(reana-server/release-please): update version in Dockerfile/OpenAPI specs (reanahub#668)

build(reana-server/docker): non-editable submodules in "latest" mode (reanahub#656)

build(reana-server/deps): pin invenio-userprofiles to 1.2.4 (reanahub#665)

ci(reana-server/release-please): initial configuration (reanahub#665)

ci(reana-server/commitlint): addition of commit message linter (reanahub#665)

chore(reana-workflow-controller/master): release 0.9.3

build(reana-workflow-controller/python): bump all required packages as of 2024-03-04 (reanahub#574)

build(reana-workflow-controller/python): bump shared REANA packages as of 2024-03-04 (reanahub#574)

feat(reana-workflow-controller/manager): increase termination period of run-batch pods (reanahub#572)

ci(reana-workflow-controller/commitlint): allow release commit style (reanahub#575)

feat(reana-workflow-controller/manager): pass custom env variables to job controller (reanahub#571)

feat(reana-workflow-controller/manager): pass custom env variables to workflow engines (reanahub#571)

docs(reana-workflow-controller/authors): complete list of contributors (reanahub#570)

ci(reana-workflow-controller/pytest): move to PostgreSQL 14.10 (reanahub#568)

fix(reana-workflow-controller/manager): use valid group name when calling `groupadd` (reanahub#566)

refactor(reana-workflow-controller/docs): move from reST to Markdown (reanahub#567)

fix(reana-workflow-controller/stop): store engine logs of stopped workflow (reanahub#563)

fix(reana-workflow-controller/manager): graceful shutdown of job-controller (reanahub#559)

feat(reana-workflow-controller/manager): call shutdown endpoint before workflow stop (reanahub#559)

refactor(reana-workflow-controller/consumer): do not update status of jobs (reanahub#559)

style(reana-workflow-controller/black): format with black v24 (reanahub#564)

ci(reana-workflow-controller/commitlint): check for the presence of concrete PR number (reanahub#562)

ci(reana-workflow-controller/shellcheck): fix exit code propagation (reanahub#562)

ci(reana-workflow-controller/release-please): update version in Dockerfile/OpenAPI specs (reanahub#558)

build(reana-workflow-controller/docker): non-editable submodules in "latest" mode (reanahub#551)

ci(reana-workflow-controller/release-please): initial configuration (reanahub#555)

ci(reana-workflow-controller/commitlint): addition of commit message linter (reanahub#555)

chore(reana-job-controller/master): release 0.9.3

build(reana-job-controller/python): bump all required packages as of 2024-03-04 (reanahub#442)

build(reana-job-controller/python): bump shared REANA packages as of 2024-03-04 (reanahub#442)

ci(reana-job-controller/commitlint): allow release commit style (reanahub#443)

build(reana-job-controller/certificates): update expired CERN Grid CA certificate (reanahub#440)

fix(reana-job-controller/database): limit the number of open database connections (reanahub#437)

docs(reana-job-controller/authors): complete list of contributors (reanahub#434)

perf(reana-job-controller/cache): avoid caching jobs when the cache is disabled (reanahub#435)

ci(reana-job-controller/pytest): move to PostgreSQL 14.10 (reanahub#429)

refactor(reana-job-controller/docs): move from reST to Markdown (reanahub#428)

ci(reana-job-controller/commitlint): check for the presence of concrete PR number (reanahub#425)

ci(reana-job-controller/shellcheck): fix exit code propagation (reanahub#425)

feat(reana-job-controller/shutdown): stop all running jobs before stopping workflow (reanahub#423)

refactor(reana-job-controller/monitor): move fetching of logs to job-manager (reanahub#423)

refactor(reana-job-controller/db): set job status also in the main database (reanahub#423)

refactor(reana-job-controller/monitor): centralise logs and status updates (reanahub#423)

style(reana-job-controller/black): format with black v24 (reanahub#426)

ci(reana-job-controller/release-please): update version in Dockerfile/OpenAPI specs (reanahub#421)

build(reana-job-controller/docker): non-editable submodules in "latest" mode (reanahub#416)

ci(reana-job-controller/release-please): initial configuration (reanahub#417)

ci(reana-job-controller/commitlint): addition of commit message linter (reanahub#417)

chore(reana-workflow-engine-cwl/master): release 0.9.3

build(reana-workflow-engine-cwl/python): bump all required packages as of 2024-03-04 (reanahub#267)

build(reana-workflow-engine-cwl/python): bump shared REANA packages as of 2024-03-04 (reanahub#267)

docs(reana-workflow-engine-cwl/conformance-tests): update CWL conformance test badges (reanahub#264)

ci(reana-workflow-engine-cwl/commitlint): allow release commit style (reanahub#268)

docs(reana-workflow-engine-cwl/authors): complete list of contributors (reanahub#266)

refactor(reana-workflow-engine-cwl/docs): move from reST to Markdown (reanahub#263)

fix(reana-workflow-engine-cwl/progress): handle stopped jobs (reanahub#260)

ci(reana-workflow-engine-cwl/commitlint): check for the presence of concrete PR number (reanahub#262)

ci(reana-workflow-engine-cwl/shellcheck): fix exit code propagation (reanahub#262)

build(reana-workflow-engine-cwl/docker): install correct extras of reana-commons submodule (reanahub#261)

ci(reana-workflow-engine-cwl/release-please): update version in Dockerfile (reanahub#259)

build(reana-workflow-engine-cwl/docker): non-editable submodules in "latest" mode (reanahub#255)

ci(reana-workflow-engine-cwl/release-please): initial configuration (reanahub#256)

ci(reana-workflow-engine-cwl/commitlint): addition of commit message linter (reanahub#256)

chore(reana-workflow-engine-serial/master): release 0.9.3

build(reana-workflow-engine-serial/python): bump all required packages as of 2024-03-04 (reanahub#200)

build(reana-workflow-engine-serial/python): bump shared REANA packages as of 2024-03-04 (reanahub#200)

ci(reana-workflow-engine-serial/commitlint): allow release commit style (reanahub#201)

docs(reana-workflow-engine-serial/authors): complete list of contributors (reanahub#199)

refactor(reana-workflow-engine-serial/docs): move from reST to Markdown (reanahub#198)

fix(reana-workflow-engine-serial/progress): handle stopped jobs (reanahub#195)

ci(reana-workflow-engine-serial/commitlint): check for the presence of concrete PR number (reanahub#197)

ci(reana-workflow-engine-serial/shellcheck): fix exit code propagation (reanahub#197)

build(reana-workflow-engine-serial/docker): install correct extras of reana-commons submodule (reanahub#196)

ci(reana-workflow-engine-serial/release-please): update version in Dockerfile (reanahub#194)

build(reana-workflow-engine-serial/docker): non-editable submodules in "latest" mode (reanahub#190)

ci(reana-workflow-engine-serial/release-please): initial configuration (reanahub#191)

ci(reana-workflow-engine-serial/commitlint): addition of commit message linter (reanahub#191)

chore(reana-workflow-engine-yadage/master): release 0.9.4

build(reana-workflow-engine-yadage/python): bump all required packages as of 2024-03-04 (reanahub#261)

build(reana-workflow-engine-yadage/python): bump shared REANA packages as of 2024-03-04 (reanahub#261)

ci(reana-workflow-engine-yadage/commitlint): allow release commit style (reanahub#262)

docs(reana-workflow-engine-yadage/authors): complete list of contributors (reanahub#260)

refactor(reana-workflow-engine-yadage/docs): move from reST to Markdown (reanahub#259)

fix(reana-workflow-engine-yadage/progress): correctly handle running and stopped jobs (reanahub#258)

ci(reana-workflow-engine-yadage/commitlint): check for the presence of concrete PR number (reanahub#257)

ci(reana-workflow-engine-yadage/shellcheck): fix exit code propagation (reanahub#257)

build(reana-workflow-engine-yadage/docker): install correct extras of reana-commons submodule (reanahub#256)

ci(reana-workflow-engine-yadage/release-please): update version in Dockerfile (reanahub#254)

build(reana-workflow-engine-yadage/docker): non-editable submodules in "latest" mode (reanahub#249)

ci(reana-workflow-engine-yadage/release-please): initial configuration (reanahub#251)

ci(reana-workflow-engine-yadage/commitlint): addition of commit message linter (reanahub#251)

chore(reana-workflow-engine-snakemake/master): release 0.9.3

build(reana-workflow-engine-snakemake/python): bump all required packages as of 2024-03-04 (reanahub#85)

build(reana-workflow-engine-snakemake/python): bump shared REANA packages as of 2024-03-04 (reanahub#85)

ci(reana-workflow-engine-snakemake/commitlint): allow release commit style (reanahub#86)

feat(reana-workflow-engine-snakemake/config): get max number of parallel jobs from env vars (reanahub#84)

feat(reana-workflow-engine-snakemake/executor): upgrade to Snakemake v7.32.4 (reanahub#81)

docs(reana-workflow-engine-snakemake/authors): complete list of contributors (reanahub#83)

refactor(reana-workflow-engine-snakemake/docs): move from reST to Markdown (reanahub#82)

fix(reana-workflow-engine-snakemake/progress): handle stopped jobs (reanahub#78)

ci(reana-workflow-engine-snakemake/commitlint): check for the presence of concrete PR number (reanahub#80)

ci(reana-workflow-engine-snakemake/shellcheck): fix exit code propagation (reanahub#80)

build(reana-workflow-engine-snakemake/docker): install correct extras of reana-commons submodule (reanahub#79)

ci(reana-workflow-engine-snakemake/release-please): update version in Dockerfile (reanahub#77)

build(reana-workflow-engine-snakemake/docker): non-editable submodules in "latest" mode (reanahub#73)

ci(reana-workflow-engine-snakemake/release-please): initial configuration (reanahub#74)

ci(reana-workflow-engine-snakemake/commitlint): addition of commit message linter (reanahub#74)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants