Error: Requires exactly one target process type, or --recursive option

hello all,
i get this error on github action deploy to heroku via yml + dockerFile.

i renew the heroku token,
make sure the app name i mine,
github have only 1 brunch - master.

this is the error from Github action Deploy:

Run akhileshns/heroku-deploy@v3.12.12
Created and wrote to ~/.netrc
 ›   Warning: Our terms of service have changed: 
 ›   https://dashboard.heroku.com/terms-of-service
WARNING! Your password will be stored unencrypted in /home/runner/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Successfully logged into heroku

Added git remote heroku
 ▸    Error: Requires exactly one target process type, or --recursive option

            Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch. 
            (If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml. 
            Specifically, the error was: Error: Command failed: heroku container:push web --app shopping-cart-6-cd --arg NODE_ENV                        ="undefined",NEXT_PUBLIC_DATABASE_CONNECTION="${NEXT_PUBLIC_DATABASE_CONNECTION}",NEXT_PUBLIC_JWT_TOKEN_SECRET="${NEXT_PUBLIC_JWT_TOKEN_SECRET}",NEXT_PUBLIC_PAYPAL_CLIENT_ID="${NEXT_PUBLIC_PAYPAL_CLIENT_ID}",NEXT_PUBLIC_PAYPAL_SECRET="${NEXT_PUBLIC_PAYPAL_SECRET}",NEXT_PUBLIC_CLOUDINARY_NAME="${NEXT_PUBLIC_CLOUDINARY_NAME}",NEXT_PUBLIC_API_KEY="${NEXT_PUBLIC_API_KEY}",NEXT_PUBLIC_API_SECRET="${NEXT_PUBLIC_API_SECRET}",NEXT_PUBLIC_GOOGLE_MAP_API="${NEXT_PUBLIC_GOOGLE_MAP_API}"
 ▸    Error: Requires exactly one target process type, or --recursive option

        
 ▸    Error: Requires exactly one target process type, or --recursive option
Error: Error: Command failed: heroku container:push web --app shopping-cart-6-cd --arg NODE_ENV                        ="undefined",NEXT_PUBLIC_DATABASE_CONNECTION="${NEXT_PUBLIC_DATABASE_CONNECTION}",NEXT_PUBLIC_JWT_TOKEN_SECRET="${NEXT_PUBLIC_JWT_TOKEN_SECRET}",NEXT_PUBLIC_PAYPAL_CLIENT_ID="${NEXT_PUBLIC_PAYPAL_CLIENT_ID}",NEXT_PUBLIC_PAYPAL_SECRET="${NEXT_PUBLIC_PAYPAL_SECRET}",NEXT_PUBLIC_CLOUDINARY_NAME="${NEXT_PUBLIC_CLOUDINARY_NAME}",NEXT_PUBLIC_API_KEY="${NEXT_PUBLIC_API_KEY}",NEXT_PUBLIC_API_SECRET="${NEXT_PUBLIC_API_SECRET}",NEXT_PUBLIC_GOOGLE_MAP_API="${NEXT_PUBLIC_GOOGLE_MAP_API}"
 ▸    Error: Requires exactly one target process type, or --recursive option

this is the docker file:

# Install dependencies only when needed
FROM node:16-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.

RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci 

FROM node:16-alpine AS builder 

ENV NEXT_PUBLIC_DATABASE_CONNECTION: "${NEXT_PUBLIC_DATABASE_CONNECTION}"      
ENV NEXT_PUBLIC_JWT_TOKEN_SECRET: "${NEXT_PUBLIC_JWT_TOKEN_SECRET}"
ENV NEXT_PUBLIC_PAYPAL_CLIENT_ID: "${NEXT_PUBLIC_PAYPAL_CLIENT_ID}"
ENV NEXT_PUBLIC_PAYPAL_SECRET: "${NEXT_PUBLIC_PAYPAL_SECRET}"
ENV NEXT_PUBLIC_CLOUDINARY_NAME: "${NEXT_PUBLIC_CLOUDINARY_NAME}"
ENV NEXT_PUBLIC_API_KEY: "${NEXT_PUBLIC_API_KEY}"
ENV NEXT_PUBLIC_API_SECRET: "${NEXT_PUBLIC_API_SECRET}"
ENV NEXT_PUBLIC_GOOGLE_MAP_API: "${NEXT_PUBLIC_GOOGLE_MAP_API}"


WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN npm run build && npm install --production --ignore-scripts --prefer-offline 


# Production image, copy all the files and run next
FROM node:16-alpine AS runner
WORKDIR /app


ENV NODE_ENV production
ENV NEXT_PUBLIC_DATABASE_CONNECTION: "${NEXT_PUBLIC_DATABASE_CONNECTION}"      
ENV NEXT_PUBLIC_JWT_TOKEN_SECRET: "${NEXT_PUBLIC_JWT_TOKEN_SECRET}"
ENV NEXT_PUBLIC_PAYPAL_CLIENT_ID: "${NEXT_PUBLIC_PAYPAL_CLIENT_ID}"
ENV NEXT_PUBLIC_PAYPAL_SECRET: "${NEXT_PUBLIC_PAYPAL_SECRET}"
ENV NEXT_PUBLIC_CLOUDINARY_NAME: "${NEXT_PUBLIC_CLOUDINARY_NAME}"
ENV NEXT_PUBLIC_API_KEY: "${NEXT_PUBLIC_API_KEY}"
ENV NEXT_PUBLIC_API_SECRET: "${NEXT_PUBLIC_API_SECRET}"
ENV NEXT_PUBLIC_GOOGLE_MAP_API: "${NEXT_PUBLIC_GOOGLE_MAP_API}"

RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

# You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json

# Automatically leverage output traces to reduce image size 
# https://nextjs.org/docs/advanced-features/output-file-tracing
 COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000

ENV PORT 3000

CMD ["npm", "run", "start"]

this is the github yml file

# https://github.com/marketplace/actions/deploy-to-heroku
name: Deploy

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2 
      - name: Deploy to Heroku
        uses: akhileshns/heroku-deploy@v3.12.12 # This is the action
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "shopping-cart-6-cd" #Must be unique in Heroku
          heroku_email: "*******"
          usedocker: true
          # buildpack enable you to extend Heroku's build system to support your language or customizations, or to make particular binary packages available to the runtime.
          buildpack: "https://github.com/HashNuke/heroku-buildpack-elixir.git"
          stack: "container"
          # healthcheck: "https://shopping-cart-6-cd.herokuapp.com/health" 
          # checkstring: "ok"
          # rollbackonhealthcheckfailed: true
          docker_build_args: |
            NODE_ENV                        
            NEXT_PUBLIC_DATABASE_CONNECTION
            NEXT_PUBLIC_JWT_TOKEN_SECRET
            NEXT_PUBLIC_PAYPAL_CLIENT_ID
            NEXT_PUBLIC_PAYPAL_SECRET
            NEXT_PUBLIC_CLOUDINARY_NAME
            NEXT_PUBLIC_API_KEY
            NEXT_PUBLIC_API_SECRET
            NEXT_PUBLIC_GOOGLE_MAP_API      
      # - run: | 
      #     git config user.email "****"   
      #     git config user.name "****" 
      #     git add -A 
      #     git commit -m "Updated code"
      #     git push heroku master
      
        env:
          NODE_ENV: production
          NEXT_PUBLIC_DATABASE_CONNECTION: "${NEXT_PUBLIC_DATABASE_CONNECTION}"
          NEXT_PUBLIC_JWT_TOKEN_SECRET: "${NEXT_PUBLIC_JWT_TOKEN_SECRET}"
          NEXT_PUBLIC_PAYPAL_CLIENT_ID: "${NEXT_PUBLIC_PAYPAL_CLIENT_ID}"
          NEXT_PUBLIC_PAYPAL_SECRET: "${NEXT_PUBLIC_PAYPAL_SECRET}"
          NEXT_PUBLIC_CLOUDINARY_NAME: "${NEXT_PUBLIC_CLOUDINARY_NAME}"
          NEXT_PUBLIC_API_KEY: "${NEXT_PUBLIC_API_KEY}"
          NEXT_PUBLIC_API_SECRET: "${NEXT_PUBLIC_API_SECRET}"
          NEXT_PUBLIC_GOOGLE_MAP_API: "${NEXT_PUBLIC_GOOGLE_MAP_API}"
        if: always()

1
for the moment i dont care to expose my env in hestory… just wont to see it working first.
2
locally the docker run to image - no prob…

thanks

I closed the other topic with almost the same question: The Error: Requires exactly one target process type, or --recursive option

My guess is that this happens because you have spaces after NODE_ENV in the yaml in the docker_build_args section so "NODE_ENV " becomes the name of the the build arg and it breakes the generated command so everything after --arg NODE_ENV becomes an other argument and interpreted as a second process type after “web”.