Error: repository does not have a default fetch remote URL and can't be named

image
Getting this error. I’m working inside of a devcontainer which runs a docker image for nodejs, my code is pushed to a private repository. I made the repo outside of the devcontainer and committed the full project to the repo. I’m guessing it has to do with using the vs code devcontainer. I’m new at using devcontainers so perhaps I set things up wrong. I can’t push my changes from inside the container, instead I open the project folder as a normal folder and push my changes from there. I do have cody extension installed inside of the container and outside of the container.

Thank you for the report. Unfortunately, Cody embeddings do not currently support Git repositories without a remote URL. You can @-mention files, though. We do intend to lift this restriction at some point.

Since I’m pushing to a private GitHub repository, doesn’t that mean that it does in fact have a remote URL? Instead of commiting my entire outer project folder would I need to commit just a src folder I’m a bit confused still.

What does git remote -v in the devcontainer report? (Be sure to strip any secrets or sensitive URLs.)

BTW, suppress embeddings error notifications by sqs · Pull Request #4476 · sourcegraph/cody · GitHub will make this error not show up each time. Will be in the prerelease build soon.

image
If I add the exception, things get very messed up like the container doesn’t match the repository. I think it must be the way I’m doing things, not sure what the proper way is. Like mounting a folder into the container. And how github will be able to push my changes properly, and for cody to create embeddings for the repository. This is my devcontainer setup:

{
  "name": "Storyboard Dev Container",
  "dockerComposeFile": "docker-compose.yml",
  "service": "nodejs",
  "remoteUser": "node",
  "workspaceFolder": "/workspace",
  "git.path": "/usr/bin/git",
  "postCreateCommand": "cd /workspace && npm install",
  "customizations": {
    "vscode": {
      "extensions": [
        "sourcegraph.cody-ai",
        "mongodb.mongodb-vscode",
        "dbaeumer.vscode-eslint",
        "Postman.postman-for-vscode",
        "esbenp.prettier-vscode",
        "DigitalBrainstem.javascript-ejs-support",
        "ecmel.vscode-html-css",
        "VisualStudioExptTeam.vscodeintellicode"
      ],
      "settings": {
        "terminal.integrated.shell.linux": "/bin/bash",
        "git.path": "/mingw64/bin/git"
      }
    }
  }
}
version: '3'
services:
  mongo-express:
    image: mongo-express
    ports:
      - 81:8081
    environment:
      ME_CONFIG_MONGODB_ADMINUSERNAME: ${DB_ROOT_USERNAME}
      ME_CONFIG_MONGODB_ADMINPASSWORD: ${DB_ROOT_PASSWORD}
      ME_CONFIG_MONGODB_SERVER: mongodb
    depends_on:
      - mongodb

  mongodb:
    image: mongo
    ports:
      - 27017:27017
    environment:
      - MONGO_INITDB_ROOT_USERNAME=${DB_ROOT_USERNAME}
      - MONGO_INITDB_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
      - MONGO_INITDB_DATABASE=admin
      - MONGO_INITDB_DB=${DB_NAME}
      - MONGO_INITDB_USERNAME=${DB_USERNAME}
      - MONGO_INITDB_PASSWORD=${DB_PASSWORD}
    restart: always
    volumes:
      - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro

  nodejs:
    image: node:18.19-bookworm
    # platform: linux/arm64/v8
    # platform: linux/amd64
    platform: ${HOST_PLATFORM:-linux/amd64}
    ports:
      - 80:3000
    working_dir: /workspace
    depends_on:
      - mongodb
    environment:
      - NODE_ENV=development
      - DB_HOST=mongodb
      - DB_USERNAME=${DB_USERNAME}
      - DB_PORT=${DB_PORT}
      - DB_PASSWORD=${DB_PASSWORD}
      - DB_NAME=${DB_NAME}
      - DB_ROOT_USERNAME=${DB_ROOT_USERNAME}
      - DB_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
    volumes:
      - ../:/workspace
    command: sleep infinity

I fixed it! I had to add this to my devconainer.json:

"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",

which I found at Avoiding Dubious Ownership in Dev Containers - Ken Muse
and then source control acted like I had 70 files that were changes to the repository. I crossed my fingers and committed the files (nothing actually changed that I could see). And now I see this:


is there any way I can now ask cody to generate the embeddings or verify that they have been made?

Doh! Maybe it is not fixed. I still see this when I start the devcontainer :frowning:

Try the prerelease build of Cody in the VS Code marketplace. (Just right-click on it in the extension panel and choose Switch to Pre-Release Version.

I rebuilt the repository and it seems like that fixed it, I no longer get the error. Still using the newest Cody extension. Must have been something goofy with my repo. Thanks!