INFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [16990]
INFO:     Started server process [18451]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
[LOAD] Modello caricato da models
🚀 Starting IDS API on http://0.0.0.0:8000
📚 Docs available at http://0.0.0.0:8000/docs
INFO:     127.0.0.1:53190 - "POST /detect HTTP/1.1" 200 OK
INFO:     127.0.0.1:50930 - "GET /stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:50942 - "POST /train HTTP/1.1" 200 OK
[TRAIN] Inizio training...
INFO:     127.0.0.1:50930 - "GET /stats HTTP/1.1" 200 OK
[TRAIN] Trovati 100000 log per training
[TRAIN] Addestramento modello...
[TRAINING] Estrazione feature da 100000 log...
INFO:     127.0.0.1:35464 - "GET /stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:33782 - "GET /stats HTTP/1.1" 200 OK
Traceback (most recent call last):
  File "/opt/ids/python_ml/main.py", line 161, in do_training
    result = ml_analyzer.train(df, contamination=request.contamination)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ids/python_ml/ml_analyzer.py", line 191, in train
    self.save_model()
  File "/opt/ids/python_ml/ml_analyzer.py", line 311, in save_model
    joblib.dump(self.model, model_path)
  File "/opt/ids/python_ml/venv/lib64/python3.11/site-packages/joblib/numpy_pickle.py", line 552, in dump
    with open(filename, 'wb') as f:
         ^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: 'models/isolation_forest.joblib'
[TRAINING] Feature estratte per 4467 IP unici
[TRAINING] Normalizzazione features...
[TRAINING] Addestramento Isolation Forest (contamination=0.01)...
[TRAIN ERROR] ❌ Errore durante training: [Errno 13] Permission denied: 'models/isolation_forest.joblib'
INFO:     127.0.0.1:39856 - "GET /stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:48214 - "GET /stats HTTP/1.1" 200 OK
                                                               