tractr / directus-sync

A CLI tool for synchronizing the schema and configuration of Directus across various environments.
GNU General Public License v3.0
232 stars 9 forks source link

Not Found: Did you add directus-extension-sync to Directus? #108

Open BorisKamp opened 5 days ago

BorisKamp commented 5 days ago

When I run docker compose exec directus npx directus-sync pull --only-collections permissions,policies,presets,roles,settings from I get the following output:

[21:10:12.986] INFO (58): Create dump folder for collections
[21:10:12.983] INFO (58): [config] No config file found. Tried path: 
- /directus/directus-sync.config.js
- /directus/directus-sync.config.cjs
- /directus/directus-sync.config.json
[21:10:12.987] INFO (58): Create dump folder for snapshot
[21:10:13.374] ERROR (58): Not Found: Did you add directus-extension-sync to Directus? Please check the version of the extension as well.
    err: {
      "type": "NotFoundError",
      "message": "Not Found: Did you add directus-extension-sync to Directus? Please check the version of the extension as well.",
      "stack":
          NotFoundError: Not Found: Did you add directus-extension-sync to Directus? Please check the version of the extension as well.
              at SettingsIdMapperClient.<anonymous> (/home/node/.npm/_npx/502cfebbe3723bc6/node_modules/directus-sync/dist/lib/services/extension-client.js:52:59)
              at Generator.next (<anonymous>)
              at fulfilled (/home/node/.npm/_npx/502cfebbe3723bc6/node_modules/directus-sync/dist/lib/services/extension-client.js:14:58)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      "status": 404,
      "statusCode": 404,
      "expose": true
    }

What is going on here? I know it used to work a few weekes ago for me, now it does not.

I have DIRECTUS_URL and DIRECTUS_TOKEN in my .env file.

EdouardDem commented 5 days ago

Did you install the directus-extension-sync inside Directus ? Here is the installation instruction : https://www.npmjs.com/package/directus-extension-sync

BorisKamp commented 4 days ago

Did you install the directus-extension-sync inside Directus ? Here is the installation instruction : https://www.npmjs.com/package/directus-extension-sync

Thankyou for your reply @EdouardDem !

Yes, I ran npm install directus-extension-sync in the root folder, here is my package.json:

{
  "name": "directus-cebv-portal",
  "type": "module",
  "version": "1.0.0",
  "description": "Please enter a description",
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  },
  "dependencies": {
    "directus-extension-sync": "^3.0.2"
  },
  "devDependencies": {
    "@antfu/eslint-config": "2.24.1",
    "husky": "^9.1.4"
  }
}

I even rebuild the docker container. In my http://localhost:8055/admin/settings/extensions I dont see the extension either. I have no clue what Im doing wrong here: https://tinyurl.com/26r5bybn

EdouardDem commented 4 days ago

How do you build the Docker container ? You should copy the folder node_modules/directus-extension-sync to ./extensions in the Docker image.'

More details here https://github.com/tractr/directus-sync/issues/63#issuecomment-2096657924

BorisKamp commented 3 days ago

How do you build the Docker container ? You should copy the folder node_modules/directus-extension-sync to ./extensions in the Docker image.'

More details here #63 (comment)

Thank you for the reply @EdouardDem , I added the following volume to my docker-compose.yml:

services:
  cache:
    image: redis:6

  directus:
    build:
      context: ./
    env_file: .env
    ports:
      - 8055:8055
    volumes:
     ...
      - ./node_modules/directus-extension-sync:/directus/extensions/directus-extension-sync

    depends_on:
      - cache

and now it works