Dev mode not syncing changes

I’m running Okteto self-hosted in EKS on AWS. I have a fairly simple application with a simple Nginx container hosting a static site. Deploying it to Okteto works fine, and the site loads correctly. Similarly, running okteto up to start a dev container, and then running the appropriate command within the dev container to start the web server (/docker-entrypoint.sh nginx -g "daemon off;") also works correctly, and the site loads properly.

However, when I make changes to files locally, they aren’t reflected in the container, and I don’t see any log messages about files being changed.

My manifest is fairly simple:

build:
  xapiens-public-site:
    context: src
    dockerfile: Dockerfile
    args:
      DEV_ENVIRONMENT: true
      DST_TIMEZONE: America/New_York
      BASE_IMAGE_REGISTRY: ${OKTETO_BUILD_XAPIENS_PUBLIC_SITE_REGISTRY}
      BASE_IMAGE_REPOSITORY: ${OKTETO_BUILD_XAPIENS_PUBLIC_SITE_REPOSITORY}
      BASE_IMAGE_DIGEST: ${OKTETO_BUILD_XAPIENS_PUBLIC_SITE_TAG}

deploy:
  - helm dependency update "helm"
  - >-
    helm upgrade --install "xapiens-public-site" "helm"
    --set global.okteto.enabled=true
    --set global.okteto.private=true
    --set ingressRoute.enabled=false
    --set ingress.enabled=true
    --set global.environment="development"
    --set global.instance="${OKTETO_NAMESPACE}"
    --set image.registry="${OKTETO_BUILD_XAPIENS_PUBLIC_SITE_REGISTRY}"
    --set image.repository="${OKTETO_BUILD_XAPIENS_PUBLIC_SITE_REPOSITORY}"
    --set image.tag="${OKTETO_BUILD_XAPIENS_PUBLIC_SITE_TAG}"
    --set config.hostname="public-site-${OKTETO_NAMESPACE}.dev.xapiens.net"

dev:
  xapiens-public-site:
    command: [ "bash" ]
    sync:
      - "./src/wwwroot:/app/wwwroot"

My .stignore is very simple:

.git

When I log into the local Syncthing interface and open up the “recent changes” window, it DOES show the files were changed:

I’m not able to log into the remote Syncthing interface – the provided username and password don’t seem to be accepted by that one.

What would my next steps be to track down the issue? Thanks!

Can you check that directory you “land on” when doing okteto up is /app/wwwroot? I’ve run into this issue it the past where Okteto is synchronizing to one folder, but my session is in a different folder. One way to ensure this is to set the workingDir property in your okteto.yaml to the same folder that you are synchronizing files to.

If that’s not the case, could you run okteto doctor from the same folder where okteto up is running. This will generate a diagnostics bundle. If you share it here (a link to an online drive or something like that is good), we can take a look at it.

No, when I run okteto up it places me at the root directory (/) in the dev container. However, I specified an absolute path in my sync line:

    sync:
      - "./src/wwwroot:/app/wwwroot"

Because of that, I would have thought the working directory wouldn’t matter.

I tried adding a workdir key to the dev section of my manifest. This did cause my dev container to come up in the wwwroot directory, but syncing still doesn’t occur.

The logs in the okteto-doctor file include some paths and hostnames on my personal machine, so I’d prefer not to post it publicly. Is there a way to provide it privately to Okteto staff, maybe?

Yes, it shouldn’t matter. I just wanted to verify it to cover our bases.

Yes. Could you share them with me via email? (is ramiro and the okteto domain)

Thanks. I sent it to you via email yesterday.

1 Like

Just wanted to post the resolution. Thanks to Okteto staff, I was able to track down the issue, and it was a problem with my Dockerfile configuration, unrelated to Okteto. I was COPYing the files to Nginx’s default wwwroot directory, /usr/share/nginx/html, and then trying to sync a different directory, /app/wwwroot. D’oh. Thanks for the help, even if it ended up being my own silly mistake!

1 Like

Thanks for asking here to help others with the same problem!