ids.alfacom.it/attached_assets/Pasted-INFO-Shutting-down-INFO-Waiting-for-application-shutdown-INFO-Application-shutdown-c-1763807174788_1763807174788.txt
marco370 0bf61dc69d Improve model training and file saving capabilities
Fixes permission errors for model saving and enhances training logging, ensuring proper storage of ML models and historical data.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 2afb7ddf-484b-4d07-8d99-8c1ca39c0be5
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/VDRknFA
2025-11-22 10:27:30 +00:00

40 lines
2.0 KiB
Plaintext

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