Network error while trying to start plugin

Hi everyone,
I recently set up a Seatable Enterprise Edition (v 4.2.11) on my laptop (Manjaro Linux 64 bits, kernel Linux 6.5.13-6) using Docker (see docker-compose bellow).

services:
  db:
    image: mariadb:10.11
    container_name: seatable-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=xxxxxxxxx                   # Root password of MySQL -- must be changed
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - /opt/seatable/mysql-data:/var/lib/mysql         # Volume of MySQL (directory for persistent storage) and mount point in container -- can be changed (not advised)
    networks:
      - seatable-net

  memcached:
    image: memcached:1.5.6
    container_name: seatable-memcached
    entrypoint: memcached -m 256
    networks:
      - seatable-net

  redis:
    image: redis:5.0.7
    container_name: seatable-redis
    networks:
      - seatable-net

  seatable:
    image: seatable/seatable-enterprise:latest
    container_name: seatable
    ports:
      - "80:80"                                         # HTTP port on the Docker host and the port in the container -- must be changed if port 80 is already in use on Docker host
      - "443:443"                                       # HTTPS port on the Docker host and the port in the container -- must be changed if port 443 is already in use on Docker host
    volumes:
      - /opt/seatable/seatable-data:/shared             # Volume of SeaTable (directory for persistent storage) and mount point in container -- can be changed (not advised)
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=xxxxxxxxx                        # Root password of MySQL -- must be changed to the value set above
      - SEATABLE_SERVER_LETSENCRYPT=True               # Decision on whether or not to use Let's Encrypt for HTTPS, default is False -- must be changed to True if a Let's Encrypt SSL certificate is to be used
      - SEATABLE_SERVER_HOSTNAME=localhost   # Host name -- must be changed
      - TIME_ZONE=Europe/Paris                               # Optional, default is UTC. Example: Europe/Berlin. Choices can be found here: http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
    depends_on:
      - db
      - memcached
      - redis
    networks:
      - seatable-net

networks:
  seatable-net:

I can access the Seatable interface, and I managed to run successfully the dtable-sdk example. Nevertheless, while trying to run seatable-plugin-template (or any other plugin), I get an Multiple CORS header 'Access-Control-Allow-Origin' not allowed error conducting to a Network Error (see bellow) while accessing localhost:3000.

{
  "stack": "AxiosError@http://localhost:3000/static/js/bundle.js:100980:19\nhandleError@http://localhost:3000/static/js/bundle.js:102550:14\n",
  "message": "Network Error",
  "name": "AxiosError",
  "code": "ERR_NETWORK",
  "config": {
    "transitional": {
      "silentJSONParsing": true,
      "forcedJSONParsing": true,
      "clarifyTimeoutError": false
    },
    "adapter": [
      "xhr",
      "http"
    ],
    "transformRequest": [
      null
    ],
    "transformResponse": [
      null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "env": {},
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "Content-Type": null,
      "Authorization": "Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxx"
    },
    "params": {
      "lang": "en"
    },
    "method": "get",
    "url": "http://localhost/dtable-server/dtables/xxxxxxxxxx-xxxxxxxxx-xxxxx-xxxxxxxxx-xxxxx"
  },
  "request": {}
}

or sometime an ERR_BAD_REQUEST error conducting to Uncaught (in promise) TypeError: this.dtableStore is null :

{
  "stack": "AxiosError@http://localhost:3000/static/js/bundle.js:100980:19\nsettle@http://localhost:3000/static/js/bundle.js:102181:12\nonloadend@http://localhost:3000/static/js/bundle.js:102499:13\n",
  "message": "Request failed with status code 404",
  "name": "AxiosError",
  "code": "ERR_BAD_REQUEST",
  "config": {
    "transitional": {
      "silentJSONParsing": true,
      "forcedJSONParsing": true,
      "clarifyTimeoutError": false
    },
    "adapter": [
      "xhr",
      "http"
    ],
    "transformRequest": [
      null
    ],
    "transformResponse": [
      null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "env": {},
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "Content-Type": null,
      "Authorization": "Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    },
    "method": "get",
    "url": "localhost/api/v2.1/dtable/app-access-token/"
  },
  "request": {},
  "response": {
    "data": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /localhost/api/v2.1/dtable/app-access-token/</pre>\n</body>\n</html>\n",
    "status": 404,
    "statusText": "Not Found",
    "headers": {
      "access-control-allow-headers": "*",
      "access-control-allow-methods": "*",
      "access-control-allow-origin": "*",
      "connection": "keep-alive",
      "content-length": "182",
      "content-security-policy": "default-src 'none'",
      "content-type": "text/html; charset=utf-8",
      "date": "Mon, 18 Dec 2023 22:16:43 GMT",
      "keep-alive": "timeout=5",
      "vary": "Accept-Encoding",
      "x-content-type-options": "nosniff",
      "x-powered-by": "Express"
    },
    "config": {
      "transitional": {
        "silentJSONParsing": true,
        "forcedJSONParsing": true,
        "clarifyTimeoutError": false
      },
      "adapter": [
        "xhr",
        "http"
      ],
      "transformRequest": [
        null
      ],
      "transformResponse": [
        null
      ],
      "timeout": 0,
      "xsrfCookieName": "XSRF-TOKEN",
      "xsrfHeaderName": "X-XSRF-TOKEN",
      "maxContentLength": -1,
      "maxBodyLength": -1,
      "env": {},
      "headers": {
        "Accept": "application/json, text/plain, */*",
        "Content-Type": null,
        "Authorization": "Token xxxxxxxxxxxxxxxxxxxxxxxxxxx"
      },
      "method": "get",
      "url": "localhost/api/v2.1/dtable/app-access-token/"
    },
    "request": {}
  }
}

Here is the setting.local.js file :

export default {
  // dtable api token (required)
  APIToken: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  // server URL of the dtable of the plugin (required)
  server: 'localhost',
  // id of the workspace with the dtable of the plugin (required, workspace must exist)
  workspaceID: '1',
  // name of the dtable to add the plugin to (required, dtable must exist under this name)
  dtableName: 'Essai',
  // default language ('en' or 'zh-cn' are common, see "src/locale/index.js" for all lang keys)
  lang: 'en'
};

I tried lots of things for server : localhost, localhost:80, https://localhost, 127.0.0.1… but nothing worked
Do you have any idea ?
Thanks a lot and have a nice day !
Bests,

Benjamin

Hello Benjamin,

I see you’re interested in creating your own plugin and considering the use of GitHub - seatable/seatable-plugin-template: This is an example to show how to write your own plugins.

I’d suggest exercising some patience and holding off for a few weeks. We’re currently in the process of revamping the plugin template, making significant improvements. Once this overhaul is complete, you’ll be rewarded with an easy-to-use, ready-made plugin template. It’s worth waiting for the enhanced version!

1 Like

Hi Christoph,
Thanks for your answer, I’m a bit relieved because I struggled quite a lot without any result, so your solution sounds quite great for me :laughing:
Please let me know when the update is released and I’ll try again then.
Bests, and a merry Christmas :slight_smile:
Benjamin

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.