exceptionless/Exceptionless

Calling/app/v2di/events keeps responding 202

Closed this issue · 9 comments

SCRIPT:
curl "http://192.168.16.53:5200/api/v2/events" \ --request POST \ --header "Authorization: Bearer MNw4SAJ9zYOocplSeMU7LwmHA4LRzizOH3GLkTDo" \ --header "Content-Type: application/json" \ --data-binary "[{'type':'log','message':'Hello World!'}]"
Response 202

exceptionless/job log:
Image

exceptionless/app log:
Image

version: "3.7"

services:
  app:
    depends_on:
      - elasticsearch
      #- redis
    image: exceptionless/app:latest
    #image: exceptionless/app:6.1.0
    environment:
      EX_AppMode: Production
      EX_ConnectionStrings__Cache: provider=redis
      EX_ConnectionStrings__Elasticsearch: server=http://elasticsearch:9200
      EX_ConnectionStrings__MessageBus: provider=redis
      EX_ConnectionStrings__Redis: server=192.168.16.3:6379,password=123,defaultDatabase=1,ssl=false,abortConnect=false
      EX_ConnectionStrings__Storage: provider=folder;path=/app/storage
      #ASPNETCORE_HTTPS_PORT: 5201
      ASPNETCORE_URLS: http://+
      #ASPNETCORE_URLS: http://+;https://+
      #ASPNETCORE_Kestrel__Certificates__Default__Password: password
      #ASPNETCORE_Kestrel__Certificates__Default__Path: /https/aspnetapp.pfx
      EX_RunJobsInProcess: "false"
    ports:
      - 5200:80
      - 5201:8080
    volumes:
      - ex_appdata:/app/storage
      - ex_ssldata:/https
    #restart: always
    security_opt:
      - seccomp:unconfined

  jobs:
    depends_on:
      - app
    image: exceptionless/job:latest
    #image: exceptionless/job:6.1.0
    environment:
      EX_AppMode: Production
      EX_BaseURL: http://localhost:5200
      EX_ConnectionStrings__Cache: provider=redis
      EX_ConnectionStrings__Elasticsearch: server=http://elasticsearch:9200
      #EX_ConnectionStrings__Email: smtps://user:password@smtp.host.com:587
      EX_ConnectionStrings__MessageBus: provider=redis
      EX_ConnectionStrings__Redis: server=192.168.16.3:6379,password=123,defaultDatabase=1,ssl=false,abortConnect=false
      #EX_ConnectionStrings__Redis: server=redis,abortConnect=false
      EX_ConnectionStrings__Storage: provider=folder;path=/app/storage
    volumes:
      - ex_appdata:/app/storage
    #restart: always
    security_opt:
      - seccomp:unconfined    

  elasticsearch:
    image: exceptionless/elasticsearch:8.15.2
    environment:
      discovery.type: single-node
      xpack.security.enabled: "false"
      ES_JAVA_OPTS: -Xms1g -Xmx1g
    ports:
      - 9200:9200
      - 9300:9300
    volumes:
      - ex_esdata:/usr/share/elasticsearch/data
    #restart: always

  kibana:
    depends_on:
      - elasticsearch
    image: docker.elastic.co/kibana/kibana:8.15.2
    ports:
      - 5601:5601
    #restart: always

volumes:
  ex_esdata:
    driver: local
  ex_appdata:
    driver: local
  ex_ssldata:
    driver: local

Is it related to this

[03:06:59 WRN] Job run Close Inactive Sessions cancelled: Unable to acquire job lock
[03:07:59 WRN] Job run Close Inactive Sessions cancelled: Unable to acquire job lock

If I change it to the following, it will be normal

EX_RunJobsInProcess: "true"

It is speculated that it is a problem with the job service. How should we handle this warning?

The inactive sessions job should only be run by one process (singleton) which is why you could be getting this. If the job died, the lock just may need to time out as well.

Also, when you are running across multiple processes you need to ensure storage is configured to point to the same path so files can be resolved for processing. 202 means the event was received but hasn't been processed, it's queue based. The event posts job needs to run to process the event.

@niemyjski
My dockercompose only runs one job service, and the prod: lock path in Redis has a key value. After deleting the key value, an error message "Unable to acquire job lock" is also reported. Excuse me, is it a bug in the job service or is there a problem with my configuration? I replaced my Redis but it still doesn't work

Hello,

You were missing the queue configuration, so it was using in memory queues and not working across processes. I added redis and used the local container, I also turned on debug logging EX_Serilog__MinimumLevel__Default: Debug

version: "3.7"

services:
  app:
    depends_on:
      - elasticsearch
      - redis
    image: exceptionless/app:latest
    #image: exceptionless/app:6.1.0
    environment:
      EX_AppMode: Production
      EX_ConnectionStrings__Cache: provider=redis
      EX_ConnectionStrings__Elasticsearch: server=http://elasticsearch:9200
      EX_ConnectionStrings__MessageBus: provider=redis
      EX_ConnectionStrings__Queue: provider=redis
      EX_ConnectionStrings__Redis: server=redis:6379,defaultDatabase=1,ssl=false,abortConnect=false
      EX_ConnectionStrings__Storage: provider=folder;path=/app/storage
      #ASPNETCORE_HTTPS_PORT: 5201
      ASPNETCORE_URLS: http://+
      #ASPNETCORE_URLS: http://+;https://+
      #ASPNETCORE_Kestrel__Certificates__Default__Password: password
      #ASPNETCORE_Kestrel__Certificates__Default__Path: /https/aspnetapp.pfx
      EX_RunJobsInProcess: "false"
    ports:
      - 5200:80
      - 5201:8080
    volumes:
      - ex_appdata:/app/storage
      - ex_ssldata:/https
    #restart: always
    security_opt:
      - seccomp:unconfined

  jobs:
    depends_on:
      - app
    image: exceptionless/job:latest
    #image: exceptionless/job:6.1.0
    environment:
      EX_AppMode: Production
      EX_BaseURL: http://localhost:5200
      EX_ConnectionStrings__Cache: provider=redis
      EX_ConnectionStrings__Elasticsearch: server=http://elasticsearch:9200
      #EX_ConnectionStrings__Email: smtps://user:password@smtp.host.com:587
      EX_ConnectionStrings__MessageBus: provider=redis
      EX_ConnectionStrings__Redis: server=redis:6379,defaultDatabase=1,ssl=false,abortConnect=false
      #EX_ConnectionStrings__Redis: server=redis,abortConnect=false
      EX_ConnectionStrings__Queue: provider=redis
      EX_ConnectionStrings__Storage: provider=folder;path=/app/storage
      #EX_Serilog__MinimumLevel__Default: Debug
    volumes:
      - ex_appdata:/app/storage
    #restart: always
    security_opt:
      - seccomp:unconfined

  elasticsearch:
    image: exceptionless/elasticsearch:8.15.2
    environment:
      discovery.type: single-node
      xpack.security.enabled: "false"
      ES_JAVA_OPTS: -Xms1g -Xmx1g
    ports:
      - 9200:9200
      - 9300:9300
    volumes:
      - ex_esdata:/usr/share/elasticsearch/data
    #restart: always

  redis:
    image: redis:7.2-alpine
    ports:
      - 6379:6379

  kibana:
    depends_on:
      - elasticsearch
    image: docker.elastic.co/kibana/kibana:8.15.2
    ports:
      - 5601:5601
    #restart: always

volumes:
  ex_esdata:
    driver: local
  ex_appdata:
    driver: local
  ex_ssldata:
    driver: local

I'll try to look at that lock message under the debugger but I wouldn't worry about it.

Hello,

You were missing the queue configuration, so it was using in memory queues and not working across processes. I added redis and used the local container, I also turned on debug logging EX_Serilog__MinimumLevel__Default: Debug

version: "3.7"

services:
  app:
    depends_on:
      - elasticsearch
      - redis
    image: exceptionless/app:latest
    #image: exceptionless/app:6.1.0
    environment:
      EX_AppMode: Production
      EX_ConnectionStrings__Cache: provider=redis
      EX_ConnectionStrings__Elasticsearch: server=http://elasticsearch:9200
      EX_ConnectionStrings__MessageBus: provider=redis
      EX_ConnectionStrings__Queue: provider=redis
      EX_ConnectionStrings__Redis: server=redis:6379,defaultDatabase=1,ssl=false,abortConnect=false
      EX_ConnectionStrings__Storage: provider=folder;path=/app/storage
      #ASPNETCORE_HTTPS_PORT: 5201
      ASPNETCORE_URLS: http://+
      #ASPNETCORE_URLS: http://+;https://+
      #ASPNETCORE_Kestrel__Certificates__Default__Password: password
      #ASPNETCORE_Kestrel__Certificates__Default__Path: /https/aspnetapp.pfx
      EX_RunJobsInProcess: "false"
    ports:
      - 5200:80
      - 5201:8080
    volumes:
      - ex_appdata:/app/storage
      - ex_ssldata:/https
    #restart: always
    security_opt:
      - seccomp:unconfined

  jobs:
    depends_on:
      - app
    image: exceptionless/job:latest
    #image: exceptionless/job:6.1.0
    environment:
      EX_AppMode: Production
      EX_BaseURL: http://localhost:5200
      EX_ConnectionStrings__Cache: provider=redis
      EX_ConnectionStrings__Elasticsearch: server=http://elasticsearch:9200
      #EX_ConnectionStrings__Email: smtps://user:password@smtp.host.com:587
      EX_ConnectionStrings__MessageBus: provider=redis
      EX_ConnectionStrings__Redis: server=redis:6379,defaultDatabase=1,ssl=false,abortConnect=false
      #EX_ConnectionStrings__Redis: server=redis,abortConnect=false
      EX_ConnectionStrings__Queue: provider=redis
      EX_ConnectionStrings__Storage: provider=folder;path=/app/storage
      #EX_Serilog__MinimumLevel__Default: Debug
    volumes:
      - ex_appdata:/app/storage
    #restart: always
    security_opt:
      - seccomp:unconfined

  elasticsearch:
    image: exceptionless/elasticsearch:8.15.2
    environment:
      discovery.type: single-node
      xpack.security.enabled: "false"
      ES_JAVA_OPTS: -Xms1g -Xmx1g
    ports:
      - 9200:9200
      - 9300:9300
    volumes:
      - ex_esdata:/usr/share/elasticsearch/data
    #restart: always

  redis:
    image: redis:7.2-alpine
    ports:
      - 6379:6379

  kibana:
    depends_on:
      - elasticsearch
    image: docker.elastic.co/kibana/kibana:8.15.2
    ports:
      - 5601:5601
    #restart: always

volumes:
  ex_esdata:
    driver: local
  ex_appdata:
    driver: local
  ex_ssldata:
    driver: local

Thank you so much. It's highly likely that I accidentally deleted EX_ConnectionStrings__Queue