2026-04-28 08:16:10,843 - main - INFO - === Logging system initialized ===
2026-04-28 08:16:10,844 - main - INFO - Log file: logs/app_20260428_081610.log
2026-04-28 08:16:10,844 - main - INFO - Log level: INFO
2026-04-28 08:16:10,844 - main - INFO - Timestamp: 20260428_081610
2026-04-28 08:16:15,083 - main - INFO - Included router: routers.aihub.router
2026-04-28 08:16:15,179 - main - INFO - Included router: routers.auth.router
2026-04-28 08:16:15,201 - main - INFO - Included router: routers.health.router
2026-04-28 08:16:15,244 - main - INFO - Included router: routers.settings.router
2026-04-28 08:16:15,491 - main - INFO - Included router: routers.storage.router
2026-04-28 08:16:15,530 - main - INFO - Included router: routers.user.router
2026-04-28 08:16:15,532 - main - INFO - === Application startup initiated ===
2026-04-28 08:16:15,532 - services.database - INFO - Ignore creating tables
2026-04-28 08:16:15,532 - services.mock_data - INFO - Ignore initialize data
2026-04-28 08:16:15,532 - services.auth - INFO - Ignore initialize admin
2026-04-28 08:16:15,532 - main - INFO - === Application startup completed successfully ===
2026-04-28 08:18:53,716 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-04-28 08:18:53,716 - core.database - WARNING - Database session maker not available, attempting lazy initialization...
2026-04-28 08:18:53,716 - core.database - WARNING - Database not initialized, attempting lazy initialization...
2026-04-28 08:18:53,716 - core.database - INFO - Starting database initialization...
2026-04-28 08:18:53,717 - core.config - DEBUG - Read dynamic attribute database_url from environment variable DATABASE_URL
2026-04-28 08:18:53,717 - core.database - INFO - Normalizing database URL for async compatibility...
2026-04-28 08:18:53,717 - core.database - INFO - Creating async database engine...
2026-04-28 08:18:53,718 - core.database - INFO - Using QueuePool with connection pooling for non-Lambda environment
2026-04-28 08:18:53,902 - core.database - INFO - Database engine created successfully
2026-04-28 08:18:53,902 - core.database - INFO - Creating async session maker...
2026-04-28 08:18:53,902 - core.database - INFO - Async session maker created successfully
2026-04-28 08:18:53,902 - core.database - INFO - Database connection initialized successfully
2026-04-28 08:18:53,902 - core.database - DEBUG - [DB_OP] Starting create_tables
2026-04-28 08:18:53,902 - core.database - INFO - 🔧 Starting table creation...
2026-04-28 08:18:54,724 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-04-28 08:18:54,725 - core.database - DEBUG - [DB_OP] Database session created successfully in 0.0003s
2026-04-28 08:18:54,725 - routers.auth - INFO - [token/exchange] Received platform token exchange request
2026-04-28 08:18:54,725 - core.config - DEBUG - Read dynamic attribute oidc_issuer_url from environment variable OIDC_ISSUER_URL
2026-04-28 08:18:54,725 - routers.auth - DEBUG - [token/exchange] Verifying token with issuer: https://auth.atoms.dev/api/v1/oidc/platform/tokens/verify
2026-04-28 08:18:54,835 - httpcore.connection - DEBUG - connect_tcp.started host='auth.atoms.dev' port=443 local_address=None timeout=5.0 socket_options=None
2026-04-28 08:18:54,897 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7f59226119c0>
2026-04-28 08:18:54,897 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x7f592641b540> server_hostname='auth.atoms.dev' timeout=5.0
2026-04-28 08:18:54,905 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7f5926ac83a0>
2026-04-28 08:18:54,906 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2026-04-28 08:18:54,906 - httpcore.http11 - DEBUG - send_request_headers.complete
2026-04-28 08:18:54,906 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2026-04-28 08:18:54,907 - httpcore.http11 - DEBUG - send_request_body.complete
2026-04-28 08:18:54,907 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2026-04-28 08:18:54,958 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Tue, 28 Apr 2026 15:18:54 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'x-response-time', b'0.001s'), (b'x-request-id', b'ba5d9c7dc8ddae53e6741f1f581249a1'), (b'cf-cache-status', b'DYNAMIC'), (b'Content-Encoding', b'gzip'), (b'Server', b'cloudflare'), (b'CF-RAY', b'9f370ad13e41c4d5-LAX')])
2026-04-28 08:18:54,958 - httpx - INFO - HTTP Request: POST https://auth.atoms.dev/api/v1/oidc/platform/tokens/verify "HTTP/1.1 200 OK"
2026-04-28 08:18:54,959 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2026-04-28 08:18:55,024 - httpcore.http11 - DEBUG - receive_response_body.complete
2026-04-28 08:18:55,025 - httpcore.http11 - DEBUG - response_closed.started
2026-04-28 08:18:55,025 - httpcore.http11 - DEBUG - response_closed.complete
2026-04-28 08:18:55,025 - httpcore.connection - DEBUG - close.started
2026-04-28 08:18:55,025 - httpcore.connection - DEBUG - close.complete
2026-04-28 08:18:55,026 - routers.auth - DEBUG - [token/exchange] Issuer response status: 200
2026-04-28 08:18:55,026 - routers.auth - DEBUG - [token/exchange] Issuer response body: {'success': True, 'data': {'exp': 1779617872, 'user_id': 1085530, 'email': 'toom3003@gmail.com', 'pv': 1}, 'message': 'Platform token verified', 'code': 0, 'timestamp': '2026-04-28T15:18:54.958840'}
2026-04-28 08:18:55,026 - routers.auth - INFO - [token/exchange] Token verified, platform_user_id=1085530, email=toom3003@gmail.com
2026-04-28 08:18:55,026 - core.config - DEBUG - Read dynamic attribute admin_user_id from environment variable ADMIN_USER_ID
2026-04-28 08:18:55,026 - routers.auth - INFO - [token/exchange] User verified: platform_user_id=1085530, role=admin
2026-04-28 08:18:55,027 - routers.auth - DEBUG - [token/exchange] User object for token issuance: id=1085530, email=toom3003@gmail.com, role=admin
2026-04-28 08:18:55,028 - core.config - DEBUG - Read dynamic attribute jwt_expire_minutes from environment variable JWT_EXPIRE_MINUTES
2026-04-28 08:18:55,028 - core.config - DEBUG - Read dynamic attribute jwt_secret_key from environment variable JWT_SECRET_KEY
2026-04-28 08:18:55,028 - core.config - DEBUG - Read dynamic attribute jwt_algorithm from environment variable JWT_ALGORITHM
2026-04-28 08:18:55,069 - core.auth - DEBUG - Authentication token created for user hash: 4f820a44
2026-04-28 08:18:55,069 - routers.auth - INFO - [token/exchange] Token issued successfully for user_id=1085530, expires_at=2026-05-28 15:18:55.028207+00:00
2026-04-28 08:18:55,069 - core.database - DEBUG - [DB_OP] Database session cleanup after 0.3449s
2026-04-28 08:18:55,343 - core.database - INFO - Tables initialized successfully
2026-04-28 08:18:55,343 - core.database - DEBUG - [DB_OP] Create tables completed in 1.4407s
2026-04-28 08:18:55,405 - core.database - INFO - Lazy database initialization completed successfully
2026-04-28 08:18:55,405 - core.database - DEBUG - [DB_OP] Database session created successfully in 1.6894s
2026-04-28 08:18:55,406 - routers.auth - INFO - [token/exchange] Received platform token exchange request
2026-04-28 08:18:55,406 - routers.auth - DEBUG - [token/exchange] Verifying token with issuer: https://auth.atoms.dev/api/v1/oidc/platform/tokens/verify
2026-04-28 08:18:55,429 - httpcore.connection - DEBUG - connect_tcp.started host='auth.atoms.dev' port=443 local_address=None timeout=5.0 socket_options=None
2026-04-28 08:18:55,491 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7f592639c160>
2026-04-28 08:18:55,491 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x7f5926dbb5c0> server_hostname='auth.atoms.dev' timeout=5.0
2026-04-28 08:18:55,513 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7f592639c0a0>
2026-04-28 08:18:55,514 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2026-04-28 08:18:55,514 - httpcore.http11 - DEBUG - send_request_headers.complete
2026-04-28 08:18:55,515 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2026-04-28 08:18:55,515 - httpcore.http11 - DEBUG - send_request_body.complete
2026-04-28 08:18:55,515 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2026-04-28 08:18:55,598 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Tue, 28 Apr 2026 15:18:55 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'x-response-time', b'0.001s'), (b'x-request-id', b'b7a7bb757cbdf89254e26c03c737d5a0'), (b'cf-cache-status', b'DYNAMIC'), (b'Content-Encoding', b'gzip'), (b'Server', b'cloudflare'), (b'CF-RAY', b'9f370ad50f075121-LAX')])
2026-04-28 08:18:55,598 - httpx - INFO - HTTP Request: POST https://auth.atoms.dev/api/v1/oidc/platform/tokens/verify "HTTP/1.1 200 OK"
2026-04-28 08:18:55,599 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2026-04-28 08:18:55,599 - httpcore.http11 - DEBUG - receive_response_body.complete
2026-04-28 08:18:55,599 - httpcore.http11 - DEBUG - response_closed.started
2026-04-28 08:18:55,599 - httpcore.http11 - DEBUG - response_closed.complete
2026-04-28 08:18:55,599 - httpcore.connection - DEBUG - close.started
2026-04-28 08:18:55,600 - httpcore.connection - DEBUG - close.complete
2026-04-28 08:18:55,600 - routers.auth - DEBUG - [token/exchange] Issuer response status: 200
2026-04-28 08:18:55,600 - routers.auth - DEBUG - [token/exchange] Issuer response body: {'success': True, 'data': {'exp': 1779617872, 'user_id': 1085530, 'email': 'toom3003@gmail.com', 'pv': 1}, 'message': 'Platform token verified', 'code': 0, 'timestamp': '2026-04-28T15:18:55.600885'}
2026-04-28 08:18:55,600 - routers.auth - INFO - [token/exchange] Token verified, platform_user_id=1085530, email=toom3003@gmail.com
2026-04-28 08:18:55,600 - routers.auth - INFO - [token/exchange] User verified: platform_user_id=1085530, role=admin
2026-04-28 08:18:55,600 - routers.auth - DEBUG - [token/exchange] User object for token issuance: id=1085530, email=toom3003@gmail.com, role=admin
2026-04-28 08:18:55,601 - core.auth - DEBUG - Authentication token created for user hash: 4f820a44
2026-04-28 08:18:55,601 - routers.auth - INFO - [token/exchange] Token issued successfully for user_id=1085530, expires_at=2026-05-28 15:18:55.600852+00:00
2026-04-28 08:18:55,601 - core.database - DEBUG - [DB_OP] Database session cleanup after 1.8849s
2026-04-28 08:19:04,714 - core.auth - DEBUG - Authentication token validated for user hash: 4f820a44
2026-04-28 08:19:35,423 - core.auth - DEBUG - Authentication token validated for user hash: 4f820a44
2026-04-28 08:22:32,388 - dependencies.auth - DEBUG - Authentication required for request GET /api/v1/auth/me
2026-04-28 08:22:33,664 - core.auth - DEBUG - Authentication token validated for user hash: 4f820a44
2026-04-28 08:22:46,728 - services.database - DEBUG - [DB_OP] Starting database close
2026-04-28 08:22:46,795 - core.database - INFO - Database connection closed and engine disposed
2026-04-28 08:22:46,795 - services.database - INFO - Database connections closed
2026-04-28 08:22:46,795 - services.database - DEBUG - [DB_OP] Database close completed in 0.0675s
