Expand my Community achievements bar.

API Mesh Local Setup: Stuck at "Starting local server..." (Docker & aio api-mesh run)

Avatar

Level 1

I'm trying to set up Adobe API Mesh locally within a Docker container and am encountering an issue
where the `aio api-mesh run` command appears to hang after starting the local server.

 

Here's a breakdown of my setup and the issue:

1. Custom Docker Container Setup:

I'm using a `docker-compose.yaml` and a custom `Dockerfile` to create my development environment.

 

# docker-compose.yaml snippet
node:
    image: node-js-lts:latest
    build:
      context: .
      dockerfile: ./base-images/node/Dockerfile
    volumes: *appvolumes # Assume this mounts my project directory
    command: tail -f /dev/null   # keep container running idle
    ports:
      - "5000:5000"

 

# ./base-images/node/Dockerfile
FROM node:lts

USER root

# Install GitHub CLI and then install aio-cli and required plugins
RUN (type -p wget >/dev/null || (apt update && apt install wget -y)) \
        && mkdir -p -m 755 /etc/apt/keyrings \
        && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
        && cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
        && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
        && mkdir -p -m 755 /etc/apt/sources.list.d \
        && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
        && apt update \
        && apt install gh -y \
    && npm install -g @ADOBE/aio-cli

# Switch to non-root user
USER app
# Disable telemetry and install API Mesh and Commerce plugins
RUN aio telemetry off
RUN aio plugins:install @ADOBE/aio-cli-plugin-api-mesh
RUN aio plugins:install https://github.com/adobe-commerce/aio-cli-plugin-commerce

# Set working directory for app
USER app
WORKDIR /var/www/html

 

2. Project Initialisation:

Inside the running Docker container, I initialised a new API Mesh project:

 

app@2f689ac8a218:~/html/adobeio$ aio api-mesh init api-mesh
? Do you want to create the workspace in /var/www/html/adobeio Yes
? Do you want to initiate git in your workspace? No
? Select a package manager yarn
? The directory is not empty. Do you want to create a sub directory with project name Yes
Creating workspace in /var/www/html/adobeio/api-mesh
Installing dependencies
yarn install v1.22.22
... (yarn output) ...
Local workspace created successfully

 

3. Environment Variable Configuration:

I added the Commerce GraphQL endpoint to the `.env` file within the `api-mesh` project directory:

 

app@2f689ac8a218:~/html/adobeio/api-mesh$ cat .env
COMMERCE_ENDPOINT="https://venia.magento.com/graphql"

 

4. Running the API Mesh:

Finally, I attempted to run the API Mesh locally:

 

app@2f689ac8a218:~/html/adobeio/api-mesh$ yarn aio api-mesh run mesh.json

yarn run v1.22.22
$ /var/www/html/adobeio/api-mesh/node_modules/.bin/aio api-mesh run mesh.json
The provided mesh contains placeholders. Starting mesh interpolation process.
This is path: /var/www/html/adobeio/api-mesh
{"level":30,"time":1760302086394,"pid":1993,"hostname":"2f689ac8a218","msg":"Beginning mesh build for meshId: testMesh"}
{"level":30,"time":1760302086394,"pid":1993,"hostname":"2f689ac8a218","msg":"Creating /var/www/html/adobeio/api-mesh/testMesh folder"}
{"level":30,"time":1760302086394,"pid":1993,"hostname":"2f689ac8a218","msg":"Writing .meshrc.json file: {\"sources\":[{\"name\":\"AdobeCommerceAPI\",\"handler\":{\"graphql\":{\"endpoint\":\"https://venia.magento.com/graphql\"}}}],\"plugins\":[{\"httpDetailsExtensions\":{}}],\"additionalResolvers\":[]}"}
{"level":30,"time":1760302086394,"pid":1993,"hostname":"2f689ac8a218","msg":"chmod 775 on .meshrc.json file....."}
{"level":30,"time":1760302086394,"pid":1993,"hostname":"2f689ac8a218","msg":"running graphqlMesh()....."}
{"level":30,"time":1760302090910,"pid":1993,"hostname":"2f689ac8a218","msg":"Build process exited with code 0"}
{"level":30,"time":1760302090911,"pid":1993,"hostname":"2f689ac8a218","msg":"Moving mesh artifacts into artifacts folder"}
{"level":30,"time":1760302090914,"pid":1993,"hostname":"2f689ac8a218","msg":"Mesh build complete"}
This is path: /var/www/html/adobeio/api-mesh
{"level":30,"time":1760302090914,"pid":1993,"hostname":"2f689ac8a218","msg":"Compiling /var/www/html/adobeio/api-mesh/mesh-artifact/testMesh ts artifacts to js"}
{"level":30,"time":1760302091256,"pid":1993,"hostname":"2f689ac8a218","msg":"Compiled /var/www/html/adobeio/api-mesh/mesh-artifact/testMesh/sources/AdobeCommerceAPI/types.ts"}
{"level":30,"time":1760302091257,"pid":1993,"hostname":"2f689ac8a218","msg":"Compiled /var/www/html/adobeio/api-mesh/mesh-artifact/testMesh/index.ts"}
{"level":30,"time":1760302091663,"pid":1993,"hostname":"2f689ac8a218","msg":"Compiled /var/www/html/adobeio/api-mesh/mesh-artifact/testMesh/sources/AdobeCommerceAPI/introspectionSchema.ts"}
Modifying mesh artifact to fix plugins for edge compatibility. ️ wrangler 4.3.0 (update available 4.42.2) ------------------------------------------------------ Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudflare.com/workers/testing/local-development. Your worker has access to the following bindings: - KV Namespaces: - MESH_KV_NAMESPACE: local-kv [simulated locally] - Vars: - MAX_STATE_KEY_SIZE_BYTES: "512" - MAX_STATE_VALUE_SIZE_BYTES: "1048576" - MIN_STATE_TTL_SECONDS: "60" - MAX_STATE_TTL_SECONDS: "604800" - SECRETS: "(hidden)" [wrangler:inf] Ready on http://localhost:5000 ⎔ Starting local server...

 

The process stops at `⎔ Starting local server...` and provides no further output. Sending a curl call to the url gets stuck as well

 

app@2f689ac8a218:~/html$ curl -v http://localhost:5000
*   Trying 127.0.0.1:5000...
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET / HTTP/1.1
> Host: localhost:5000
> User-Agent: curl/7.88.1
> Accept: */*
>

 

Is there any configuration I am missing ?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies