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

Cannot build a stack over git repository #12347

Open
2 tasks done
algues111 opened this issue Oct 24, 2024 · 1 comment
Open
2 tasks done

Cannot build a stack over git repository #12347

algues111 opened this issue Oct 24, 2024 · 1 comment
Labels

Comments

@algues111
Copy link

algues111 commented Oct 24, 2024

Before you start please confirm the following.

Problem Description

Hello !

I'm trying to build a stack from a git repository, my credentials are ok (github app PAT token), but I'm ending up with 1 issue when I click the "Deploy the stack" button : Top-level object must be a mapping

Expected Behavior

Deploy the stack properly !

Actual Behavior

Here is what I found on docker logs of portainer :

WRN github.com/portainer/portainer@v0.6.1-0.20240906003626-280ca22aebb2/pkg/libstack/compose/internal/composeplugin/composeplugin.go:171 > docker compose command failed | error="exit status 15" error_output="Top-level object must be a mapping\n" output=

Steps to Reproduce

Create a private git repo on GitHub for example
Fill authentication with your account or PAT token

Build...

Portainer logs or screenshots

2024/10/24 03:33PM WRN github.com/portainer/portainer@v0.6.1-0.20240906003626-280ca22aebb2/pkg/libstack/compose/internal/composeplugin/composeplugin.go:171 > docker compose command failed | error="exit status 15" error_output="Top-level object must be a mapping\n" output=

Portainer version

2.23.0

Portainer Edition

Business Edition (BE/EE) with Professional or Enterprise license

Platform and Version

Docker Compose version v2.29.7

OS and Architecture

Ubuntu 24

Browser

Brave

What command did you use to deploy Portainer?

services:
traefik:
image: traefik:v3.0
container_name: traefik
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/srv/trybecard/compose/src/traefik.toml:/etc/traefik/traefik.toml"
- "/srv/trybecard/compose/letsencrypt/acme.json:/acme.json"
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(mydomain.com) && (PathPrefix(/api) || PathPrefix(/dashboard))"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=admin:$$gIuXvvrT2Td0"
- "traefik.http.middlewares.strip-www.redirectregex.regex=^https?://(www\.)(.+)"
- "traefik.http.middlewares.strip-www.redirectregex.replacement=https://$${2}"
- "traefik.http.middlewares.strip-www.redirectregex.permanent=true"
- "--certificatesresolvers.default.acme.email=myemail"
- "--certificatesresolvers.default.acme.storage=letsencrypt/acme.json"

deploy:
  resources:
    limits:
      memory: 192M

networks:
  web:
    ipv4_address: 172.18.0.2

minio:
image: minio/minio:RELEASE.2024-10-02T17-50-41Z
volumes:
- minio_storage:/data

environment:
  MINIO_ROOT_USER: ${MINIO_ROOT_USER}
  MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
command: server --console-address ":9001" /data
labels:

  - "traefik.enable=true"

  - "traefik.http.routers.minio-api.rule=Host(`mydomain.com`)"
  - "traefik.http.routers.minio-api.entrypoints=websecure"
  - "traefik.http.routers.minio-api.tls=true"
  - "traefik.http.routers.minio-api.tls.certresolver=default"
  - "traefik.http.routers.minio-api.service=minio-api-service"
  - "traefik.http.services.minio-api-service.loadbalancer.server.port=9000"

  - "traefik.http.routers.minio-console.rule=Host(`mydomain.com`)"
  - "traefik.http.routers.minio-console.entrypoints=websecure"
  - "traefik.http.routers.minio-console.tls=true"
  - "traefik.http.routers.minio-console.tls.certresolver=default"
  - "traefik.http.routers.minio-console.service=minio-console-service"
  - "traefik.http.services.minio-console-service.loadbalancer.server.port=9001"

deploy:
  resources:
    limits:
      memory: 256M

networks:
  web:
    ipv4_address: 172.18.0.3

db:
hostname: postgres
image: postgres
ports:
- 5432:5432

volumes:
  - postgres_data:/var/lib/postgresql/data
  - /srv/trybecard/compose/data/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro

environment:
  POSTGRES_PASSWORD: ${DB_ROOT_PASSWORD}
  POSTGRES_USER: ${DB_ROOT_USER}
  POSTGRES_DB: trybecard_db1

command:
  - "postgres"
  - "-c"
  - "listen_addresses=*"
deploy:
  resources:
    limits:
      memory: 256M

networks:
  web:
    ipv4_address: 172.18.0.4

trybecardch:
image : username/myrepo:latest
container_name: dockerapp

labels:
  - "traefik.enable=true"
  - "traefik.http.routers.dockerapp.rule=Host(`mydomain.com`)"
  - "traefik.http.routers.dockerapp.entrypoints=websecure"
  - "traefik.http.services.dockerapp.loadbalancer.server.port=3000"
  - "traefik.http.routers.dockerapp.tls=true"


networks:
  web:
    ipv4_address: 172.18.0.9

volumes:
minio_storage: {}
postgres_data: {}

networks:
web:
external: true

driver: bridge
ipam:
  config:
    - subnet: 172.18.0.0/16

Additional Information

I verified my compose.yaml file muuuultiple times, without success...

I don't know where it comes form because I tried to build a stack over https://github.com/docker/awesome-compose/blob/master/wordpress-mysql/compose.yaml and it works....

@tylerhunt
Copy link

I'm having the same issue. I've verified that Portainer is able to access the repository.

The same docker-compose.yml file works fine when pasted into the editor.

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

No branches or pull requests

3 participants
@tylerhunt @algues111 and others