guy0090 / LostArkLogs

5 stars 7 forks source link

Upload logs Problem #4

Open xfouloux opened 2 years ago

xfouloux commented 2 years ago

When i try to upload logs (or on https://lail.ai/ulog for that matters) i get a : Failed to upload: Invalid Request

in logs i can see

api      | 2022-08-11 07:26:54 error: [POST] /logs/raw/upload >> StatusCode:: 400, Message:: This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.
xfouloux commented 2 years ago

had to add to docker-compose.yml this for mongo service command: --replSet rs0

so it looks like this

  mongo:
    image: mongo:latest
    container_name: mongo
    ports:
      - '127.0.0.1:27016:27017'
    networks:
      - backend
    volumes:
      - ./mongo/data:/data/db
    command: --replSet rs0

then after start,

# docker exec -it mongo bash
root@3c2dce1d9bb0:/# mongo 
> rs.initiate() 

to init the mongo replica then docker-compose restart

now i can send uploads, without having mongo failing, but another issue arrise.

api      | 2022-08-12 00:15:14 error: [POST] /logs/raw/upload >> StatusCode:: 400, Message:: Cannot read property 'totalHealingDone' of undefined 
guy0090 commented 2 years ago

Hey, sorry yeah a lot of these issues stem from the readme being out of date. I'll update that today to clear up some issues.

Could you send me an example of the log file you're trying to upload?

xfouloux commented 2 years ago

this one for example ;)

pretty sure it has to do with the merge request you trying to pass in loa-details, that have all thoose fields.

guy0090 commented 2 years ago

Thanks, I fixed this in 6b9bbac4cb29e3627d42d1b37d6122df8ac08e9d. Should be working on https://lail.ai/ulog if you try again.

xfouloux commented 2 years ago

Hey,

indeed, works great now !

I'll try to redeploy on my server tomorrow =) ! Thanks !

Akis-M commented 2 years ago

Still not working for me. Getting the same "Failed to upload: Invalid Request" error no matter which log I try to upload. @guy0090

xfouloux commented 2 years ago

Still not working for me. Getting the same "Failed to upload: Invalid Request" error no matter which log I try to upload. @guy0090

Did you pull the new commit ? especially the part that starts mongodb with replica set ?

guy0090 commented 2 years ago

This seems to be a limitation of MongoDB's maximum document size (16MB). It'll take a while to fix, in the meantime can you try uploading a file smaller than 16MB? @omonoiatis9

xfouloux commented 2 years ago

Well, you could also not choose to upload the file, but maybe allow to select encounter, so from a file you could only upload a subset of it, and then if the dude uploading the file wants all the encounters, or it's more than 16Mb anyways, you upload chuncks by chunks (encounter per encounter) Noone encounter should be more than 16Mb i bet

guy0090 commented 2 years ago

Well, you could also not choose to upload the file, but maybe allow to select encounter, so from a file you could only upload a subset of it, and then if the dude uploading the file wants all the encounters, or it's more than 16Mb anyways, you upload chuncks by chunks (encounter per encounter) Noone encounter should be more than 16Mb i bet

Average log size (once I reformat it for the UI) is around 15kb. The actual log lines are what is inflating it because I save the raw log along with any found logs within it. I'll most likely switch to using GridFS for raw logs or scrap saving them as well entirely, not sure atm.