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

A valid repository for "/template" could not be found #2842

Closed
kaparwan opened this issue Oct 10, 2020 · 8 comments
Closed

A valid repository for "/template" could not be found #2842

kaparwan opened this issue Oct 10, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@kaparwan
Copy link
Contributor

While creating a new component "Create a new component α" using Available Templates
Create new software components using standard templates
Golang Microservice

It is not succeeding.

Component should get created.

Steps to Reproduce

  1. Step 1 :
    Use Available templets for component creation

  2. Step 2

Choose Golang Microservice

  1. Step 3

Fill in template parameters and below were the details for review I clicked on - "Review and create"

Docker Image alpine-base-image:latest
Docker Build Image golang
Docker Build Image Version alpine
Use Logrus Logging y
Use Viper Config y
Use Cobra Cmd y
Use Ci github
Component Id goLangMS
Project Short Description goLangMS
Owner Guest
Store Path kaparwan/temp1

Context

I am trying to create new component - Golang repo

Failed to create component
{"status":"Digest: sha256:0e2891bebc903eeedf7293cf75e9faad7539874e9d4e5e37da91760e2c8fab60"}
{"status":"Status: Image is up to date for spotify/backstage-cookiecutter:latest"}
DEBUG cookiecutter.config: User config not found. Loading default config.
A valid repository for "/template" could not be found in the following locations:
/template
/template

Your Environment

I am using docker containers ( backend and frontend ) running in aws ec2 .

  • NodeJS Version (v12): v12.18.4
  • Operating System and Version (e.g. Ubuntu 14.04): CentOS Linux release 7.7.1908 (Core)
  • Browser Information: Chrome
@kaparwan kaparwan added the bug Something isn't working label Oct 10, 2020
@Rugvip Rugvip changed the title [RFC] A valid repository for "/template" could not be found A valid repository for "/template" could not be found Oct 12, 2020
@benjdlambert
Copy link
Member

Hey @kaparwan, i think that this could be something to do with not being able to mount the folder inside the container. This seems to work on mac and ubuntu at least I'm wondering if it's something to with centos and permissions.

Have you experienced any of this before?

@andrewhertog
Copy link

I'm seeing the same thing. I'm running in kubernetes, and it doesn't seem like this is designed to properly use kubernetes pods and volume mounts. Reading through the code it runs docker directly on the host, so the file paths don't match with what is in the pod trying to spin up the docker container.

@benjdlambert
Copy link
Member

@andrewhertog yep - for the simple iteration of the scaffolder we didn't really consider k8s, but we've been making some great steps on the next version and what it could look like here: #2577

We will be taking more consideration to k8s in this version to help enable running these jobs in pods and jobs in k8s.

Feel free to add some usecases to that list if you feel theres something missing.

Still interested to find out why this doesn't work exactly as planned though. Seems like a strange error as if cookiecutter is installed on the pod then it should use the local version of cookiecutter, nothing to do with docker in docker or anything like that. Can you get some more logs?

@andrewhertog
Copy link

@benjdlambert So I switched to running cookiecutter in the same pod as the backend service. It seems to be working better now, as i'm blocked further down the pipeline with a different error now.

@freben
Copy link
Member

freben commented Nov 5, 2020

@andrewhertog Hi again! Shall we close this issue for now? You are more than welcome to ask followups on Discord or open separate issues for later errors, of course.

@andrewhertog
Copy link

@freben I'm not the original poster, I'd ask @kaparwan if you can close it. I've resolved the issue on my part, but I'm not sure if the solution would be a fix for @kaparwan My sugestion to them would be to use the backend docker image with kustomize installed in it to avoid the headache of running docker in docker or trying to manage other containers.

@benjdlambert
Copy link
Member

Gonna close this - @kaparwan if this isn't fixed please re-open :)

@wyattwalter
Copy link

Adding this for anyone who finds this later:

I worked around this in my docker-compose setup by mounting /tmp into the backend container. What seems to be happening is that the backstage backend app creates a couple of temp directories and then tries to bind mount them in a temporary container based on the cookiecutter image. Since I'm running the backend in a Docker container, that temp directory is local to the container and not seen by the temporary cookiecutter container.

To be more explicit, I added this under volumes in my service definition in docker-compose.yaml:

    volumes:
      ...
      - /tmp:/tmp

I further segmented it by setting app.workingDirectory to /tmp/backstage and changed the bind mount to that directory as well, but not strictly necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants