Skip to content

The docker-compose-rest has defined a network, which is not the same …#2788

Closed
milanmajchrak wants to merge 1 commit intoDSpace:mainfrom
dataquest-dev:cli-wrong-network
Closed

The docker-compose-rest has defined a network, which is not the same …#2788
milanmajchrak wants to merge 1 commit intoDSpace:mainfrom
dataquest-dev:cli-wrong-network

Conversation

@milanmajchrak
Copy link
Copy Markdown
Contributor

@milanmajchrak milanmajchrak commented Feb 1, 2024

Description

The error docker/cli.yml: (root) must be a mapping occurred when I tried to create an administrator using docker compose command with these docker compose files docker-compose.yml, docker-compose-rest.yml, cli.yml.
The full command is: docker compose -p dspace7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/cli.yml run --rm dspace-cli create-administrator -e admin@admin.test -f admin -l user -p admin -c en

Instructions for Reviewers

The docker-compose-rest.yml file includes ipam in the networks section, but this part of code is missing in the cli.yml. Consequently, when I run docker compose cli using docker compose files: docker-compose-rest.yml and cli.yml files in that sequence (docker-compose-rest.yml before cli.yml), it throws an error.

List of changes in this PR:

  • Copied ipam network from the docker-compose-rest.yml into cli.yml

How to reproduce:

  1. Run DSpace7.6.1. in the docker
  2. Try to create an administrator using the following command: docker compose -p dspace7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/cli.yml run --rm dspace-cli create-administrator -e admin@admin.test -f admin -l user -p admin -c en

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue
Copy link
Copy Markdown
Member

tdonohue commented Feb 2, 2024

@milanmajchrak : The documentation on using the create-administrator tools says to run this as two commands:

  1. First start everything up: docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
  2. Then run create-administrator: docker-compose -p d7 -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en

Is there a reason you want to run this as a single command? It works fine (for me) when run as two commands.

Essentially, the "cli.yml" script was built with the assumption that the backend is already running. So, I think the issue you described might be a side effect of simply trying to run it in a manner that it wasn't designed. But, let me know if I'm misunderstanding.

@tdonohue
Copy link
Copy Markdown
Member

tdonohue commented Feb 2, 2024

@milanmajchrak : Oh, I just figured out what is going on. You are correct that the ci.yml has a flaw in it...and it's using a different network. I've realized this dspace-angular issue is directly related to a bug I found in the backend Docker scripts. See DSpace/DSpace#9302 and fix at DSpace/DSpace#9303

I think your proposed fix in this PR is "ok", but it requires syncing the network settings between the cli.yml and docker-compose-rest.yml files. Instead, I think we should update the cli.yml to properly reference the network defined already in docker-compose-rest.yml. I'll create an alternative PR for that later today (still testing it out)

@tdonohue
Copy link
Copy Markdown
Member

tdonohue commented Feb 2, 2024

Alternative version of this PR is in #2791 . The alternative solution updates the cli.yml file to use the network defined already in docker-compose-rest.yml

@milanmajchrak
Copy link
Copy Markdown
Contributor Author

@tdonohue Thank you very much! I suppose this PR could be closed, right?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 5, 2024

Hi @milanmajchrak,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue
Copy link
Copy Markdown
Member

tdonohue commented Feb 5, 2024

@milanmajchrak : Yes, this can now be closed as I just merged #2791. (I had been waiting to merge the other PR before closing this.)

@tdonohue tdonohue closed this Feb 5, 2024
4science-it pushed a commit to 4Science/dspace-angular that referenced this pull request Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend: Docker related to DSpace deployment via Docker bug merge conflict

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants