crawlab-team / crawlab

Distributed web crawler admin platform for spiders management regardless of languages and frameworks. 分布式爬虫管理平台,支持任何语言和框架
https://www.crawlab.cn
BSD 3-Clause "New" or "Revised" License
11.38k stars 1.8k forks source link

求助 | 各种请求新建操作均无响应,不清楚什么地方配置出错了 #1149

Closed Indulgeinu closed 2 years ago

Indulgeinu commented 2 years ago

进入了管理平台但是各种新建操作都无法完成,比如新建项目会返回下面之类的操作信息:face_with_spiral_eyes::face_with_spiral_eyes::face_with_spiral_eyes:

crawlab_master   | [GIN] 2022/07/24 - 22:47:03 | 400 |    2.186658ms |       127.0.0.1 | PUT      "/projects"
......
crawlab_master   | node error: not exists
......
crawlab_master   | mongo: no documents in result
......

docker-compose.yml配置如下:

# 主节点
version: '3.3'
services:
  mongo:
    image: mongo
    container_name: mongo
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root  # mongo username
      MONGO_INITDB_ROOT_PASSWORD: 123456  # mongo password
    volumes:
      - "/opt/crawlab/mongo/data/db:/data/db"  # 持久化 mongo 数据
    ports:
      - "27017:27017"  # 开放 mongo 端口到宿主机

  mongo-express:
    image: mongo-express
    container_name: mongo-express
    restart: always
    depends_on: #设置依赖,这里用来代替links字段
      - mongo
    ports: #对外的映射端口,这里使用了27016,容器宿主机本机访问的地址:http://localhost:27016,外网的话改为ip:port.
      # - "27016:8081"
      - "8081:8081"
    environment:
      ME_CONFIG_MONGODB_SERVER: mongo #服务名是mongo容器的名字
      ME_CONFIG_MONGODB_PORT: 27017
      ME_CONFIG_BASICAUTH_USERNAME: admin #登陆页面时候的用户名
      ME_CONFIG_BASICAUTH_PASSWORD: 123456 #登陆页面的用户密码
      ME_CONFIG_MONGODB_ADMINUSERNAME: root #mongo验证的用户名
      ME_CONFIG_MONGODB_ADMINPASSWORD: 123456 #mongo验证的用户密码

  master:
    image: crawlabteam/crawlab
    container_name: crawlab_master
    restart: always
    environment:
      CRAWLAB_NODE_MASTER: Y  # Y: 主节点
      CRAWLAB_MONGO_HOST: mongo  # mongo host address. 在 Docker-Compose 网>络中,直接引用 service 名称
      CRAWLAB_MONGO_PORT: 27017  # mongo port
      CRAWLAB_MONGO_DB: crawlab  # mongo database
      CRAWLAB_MONGO_USERNAME: root  # mongo username
      CRAWLAB_MONGO_PASSWORD: '123456'  # mongo password
      CRAWLAB_MONGO_AUTHSOURCE: admin  # mongo auth source
    volumes:
      - "/opt/crawlab/master:/data"  # 持久化 crawlab 数据
    ports:
      - "8080:8080"  # 开放 api 端口
      - "9666:9666"  # 开放 grpc 端口
    depends_on:
      - mongo
mayuanyuan199625 commented 2 years ago

我这也是一摸一样的情况 各种新建项目 新建爬虫都没有反应 接口出现400状态码

tikazyq commented 2 years ago

尝试拉取最新镜像,之前镜像前端有问题

Indulgeinu commented 2 years ago

已经拉取了最新镜像,仍然400 image image image

Indulgeinu commented 2 years ago

命令行连接到mongo可以正常实现新建并显示到前端,但是从前端上PUT还是不行~

tikazyq commented 2 years ago

https://hub.docker.com/r/crawlabteam/crawlab/tags

请查看一下是否为最新的hash

Indulgeinu commented 2 years ago

https://hub.docker.com/r/crawlabteam/crawlab/tags

请查看一下是否为最新的hash

sha256值是一致无误的~ 我发现在请求主页时显示有个js文件404,不清楚有无影响~ image

tikazyq commented 2 years ago

哪一个接口有问题?

Indulgeinu commented 2 years ago

api/projects、api/spiders等PUT请求都无法执行,仍然会返回request payload invalid,和 #1150 #1151 中描述的问题一样

tikazyq commented 2 years ago

拉取最新镜像后,刷新一下浏览器缓存试试

Indulgeinu commented 2 years ago

拉取最新镜像后,刷新一下浏览器缓存试试

十分感谢!