processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.01k stars 1.5k forks source link

The ejabberd.yaml configuration of my two servers is the same, why the interface format of the requested API is inconsistent #4086

Open skrleo opened 10 months ago

skrleo commented 10 months ago

Before creating a ticket, please consider if this should fit the discussion forum better.

Environment

loglevel: 4
...

Errors from error.log/crash.log

No errors

Bug description

one: http://xxx.xxx.xxx.99:5443/api/status

"The node ejabberd@localhost is started. Status: startedejabberd 0.0.0 is running in that node"

two: http://xxx.xxx.xxx.214:5443/api/status

{
"status": "error",
"code": 32,
"message": "AccessRules: Account does not have the right to perform the operation."
}

ejabberd.yaml configuration :

listen:
  -
    port: 5280
    ip: "::"
    module: ejabberd_http
    request_handlers:
      /api: mod_http_api
      /oauth: ejabberd_oauth

oauth_expire: 3600
oauth_access: all

Need to return data in JSON format, it should be mod_http_api processed.

and use docker-composer can't echo log

  ejabberd:
    image: ejabberd/ecs
    # image: simpleman/ejabberd:1.0.4
    container_name: ejabberd
    environment:
      - CTL_ON_CREATE=register 1000 192.168.xx.xx 1000
      - EJABBERD_LOG_PATH=/home/ejabberd/logs
    healthcheck:
      test: netstat -nl | grep -q 5222
      start_period: 5s
      interval: 5s
      timeout: 5s
      retries: 120
    user: root
    ports:
      - "5222:5222"
      - "5269:5269"
      - "5280:5280"
      - "5443:5443"
      # - "3478:3478"
      # - "3478:3478/udp"
      # - "5349:5349"
      # - "5349:5349/udp"
      - "4200-4210:4200-4210"
      # - "5060:5060/tcp"
      # - "5060:5060/udp"
      # - "49152-49252:49152-49252"
      # - "49152-49252:49152-49252/udp"
    #extra_hosts:
    volumes:
      - ./ejabberd/conf/ejabberd.yml:/home/ejabberd/conf/ejabberd.yml
      - ./ejabberd/conf/ejabberdctl.cfg:/home/ejabberd/conf/ejabberdctl.cfg
      - ./ejabberd/logs:/home/ejabberd/logs
      - ./ejabberd/database:/home/ejabberd/database
    restart: always
    logging: *default-logging
    networks:
      - network

I could not get through this error. Any help is greatly appreciated.

Please, give us a precise description (what does not work, what is expected, etc.)

skrleo commented 10 months ago
2023-09-08 05:55:40.324790+00:00 [critical] Failed to set logging: {error,
                           {handler_not_added,
                               {open_failed,"/home/ejabberd/logs",eisdir}}}
badlop commented 10 months ago

{open_failed,"/home/ejabberd/logs",eisdir}}}

See https://stackoverflow.com/a/77088457/6039301