Invalid compose name: must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character

Today i wanted to deploy a new feature for my branch. But now i get this error
Found okteto compose manifest on docker-compose.yml` `Unmarshalling compose...` `x Invalid compose name: must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character` , last weeks this didn’t happen, does anyone know what is going wrong?
My docker-compose.yml

# For more information: https://laravel.com/docs/sail
version: '3.9'
services:
    laravel:
        build:
            context: ./
            dockerfile: Dockerfile
            args:
                APP_KEY: '${APP_KEY}'
                GEO_API_KEY: '${GEO_API_KEY}'
                DB_HOST: '${DB_HOST}'
                DB_PORT: '${DB_PORT}'
                DB_DATABASE: '${DB_DATABASE}'
                DB_USERNAME: '${DB_USERNAME}'
                DB_PASSWORD: '${DB_PASSWORD}'
                MAIL_HOST: '${MAIL_HOST}'
                MAIL_PORT: '${MAIL_PORT}'
                MAIL_USERNAME: '${MAIL_USERNAME}'
                MAIL_PASSWORD: '${MAIL_PASSWORD}'
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '80:8080'
        env_file:
            - .env.dist
        environment:
            LARAVEL_SAIL: 1
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            APP_ENV: '${APP_ENV:-local}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
            DB_HOST: '${DB_HOST}'
            DB_PORT: '${DB_PORT}'
            DB_DATABASE: '${DB_DATABASE}'
            DB_USERNAME: '${DB_USERNAME}'
            DB_PASSWORD: '${DB_PASSWORD}'
            REDIS_HOST: 'redis'
        volumes:
            - '.:/app'
            - 'portal-assets:/app/storage'
        depends_on:
            mysql:
                condition: service_healthy
            redis:
                condition: service_healthy
        networks:
            - sail
    mysql:
        image: 'mysql/mysql-server:8.0'
        ports:
            - '3306:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: '${DB_HOST}'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1
        volumes:
            - 'sail-mysql:/var/lib/mysql'
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
        networks:
            - sail
    redis:
        image: 'redis:alpine'
        ports:
            - '6379:6379'
        volumes:
            - 'sail-redis:/data'
        healthcheck:
            test: ["CMD", "redis-cli", "ping"]
            retries: 3
            timeout: 5s
        networks:
            - sail
networks:
    sail:
        driver: bridge
volumes:
    sail-mysql:
        driver: local
    sail-redis:
        driver: local
    portal-assets:
        driver: local

Hi @mvpdsolutions !

How are you deploying the compose? via UI or CLI?

In case of doing it with the CLI, which command are you using? which CLI version?

In case of doing it via UI, Are you using cloud.okteto.com or a self-hosted instance?

Hey @nacho,

I am using the UI on cloud.okteto.com.

Hi @mvpdsolutions !

We are not able to reproduce the issue. Is the compose used as part of an Okteto manifest as mentioned here? How is it called the repository your are deploying?

The error means that the application name is not k8s compliance. Did you change something related to that? If no name is specified, by default it takes the repository name

Hi Nacho,

At the moment i don’t use a manifest. This is how I deploy (see picture), I have not changed anything about my deploy. It just suddenly stopped working.

Are you sure that there is no solution for this? Because i’m stuck. Five days ago the same issue was posted on stackoverflow. dockerfile - Invalid compose name even docker-compose.yaml exists - Stack Overflow

This is my Dockerfile:

FROM php:8.1

RUN curl -sL https://deb.nodesource.com/setup_16.x | bash
RUN apt-get update -y && apt-get install -y --no-install-recommends openssl zip unzip git nodejs

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
    install-php-extensions @composer curl gd mbstring openssl fileinfo mysqli pdo_mysql zip

ADD ./uploads.ini /usr/local/etc/php/conf.d/uploads.ini

COPY . /app
WORKDIR /app

RUN composer install
RUN npm i -g yarn
RUN yarn install
RUN yarn prod
RUN rm -rf node_modules/

RUN cp -f .env.dist .env
ARG APP_KEY
ARG GEO_API_KEY
ARG DB_HOST
ARG DB_PORT
ARG DB_DATABASE
ARG DB_USERNAME
ARG DB_PASSWORD
ARG MAIL_HOST
ARG MAIL_PORT
ARG MAIL_USERNAME
ARG MAIL_PASSWORD
RUN sed -i "s|APP_KEY=|APP_KEY=${APP_KEY}|g" .env
RUN sed -i "s|GEO_API_KEY=|GEO_API_KEY=${GEO_API_KEY}|g" .env
RUN sed -i "s|DB_HOST=|DB_HOST=${DB_HOST}|g" .env
RUN sed -i "s|DB_PORT=|DB_PORT=${DB_PORT}|g" .env
RUN sed -i "s|DB_DATABASE=|DB_DATABASE=${DB_DATABASE}|g" .env
RUN sed -i "s|DB_USERNAME=|DB_USERNAME=${DB_USERNAME}|g" .env
RUN sed -i "s|DB_PASSWORD=|DB_PASSWORD=${DB_PASSWORD}|g" .env
RUN sed -i "s|MAIL_HOST=|MAIL_HOST=${MAIL_HOST}|g" .env
RUN sed -i "s|MAIL_PORT=|MAIL_PORT=${MAIL_PORT}|g" .env
RUN sed -i "s|MAIL_USERNAME=|MAIL_USERNAME=${MAIL_USERNAME}|g" .env
RUN sed -i "s|MAIL_PASSWORD=|MAIL_PASSWORD=${MAIL_PASSWORD}|g" .env

RUN php artisan key:generate

RUN apt-get -y autoremove \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

CMD php artisan config:cache \
  & php artisan migrate --seed \
  & php artisan orchid:admin admin admin@admin.com password \
  & php artisan storage:link \
  & php artisan queue:work \
  & php artisan serve --host=0.0.0.0 --port=8080

EXPOSE 8080

Hey @nacho.

I run my deployment without an okteto manifest. I tried running the same code on another namespace and there it does not fail, this definitely has something to do with okteto.

It looks like when I destroy a environment and then try to rebuild it. The manifest fails.

Milo

HI @mvpdsolutions ,

we have identified the root cause and we are working on a fix but we don’t have an ETA for now. Probably it’ll be out early next week.

In the meantime, can you try to deploy it using the CLI to see if that works? Can you try with okteto pipeline deploy --name=backend-uitzendbureau --repository=https://<your-repo> --branch=development --var=APP_KEY=<value>? It is important to specify parameter --name to avoid the error.

Nacho

Hi @nacho,

Thank you for looking into the issue. For now I have the workaround, so I will wait until next week. When the issue is fixed.

Hi @nacho,

even I’m facing a similar issue while deploying my code. I tried deploying it with the help of cli as well, the way you suggested using okteto pipeline deploy, but unfortunately I’m still facing the same issue. can you please suggest an estimate as to when will this be fixed?

regards,
Rohit

Hi @Rohit-Ranjane ,

Our estimation is to have the fix in Cloud between today and tomorrow. I’ll keep you posted.

Nacho

Hi @Rohit-Ranjane and @mvpdsolutions ,

the fix took a bit longer we expected but we just applied it, so you should be able to deploy the repositories again from the UI.

1 Like