2026-05-02 09:44:58,476 - main - INFO - === Logging system initialized ===
2026-05-02 09:44:58,476 - main - INFO - Log file: logs/app_20260502_094458.log
2026-05-02 09:44:58,476 - main - INFO - Log level: INFO
2026-05-02 09:44:58,476 - main - INFO - Timestamp: 20260502_094458
2026-05-02 09:44:58,540 - main - INFO - Included router: routers.admin_dashboard.router
2026-05-02 09:44:58,594 - main - INFO - Included router: routers.agent_availability.router
2026-05-02 09:45:00,312 - main - INFO - Included router: routers.ai_ticket_summary.router
2026-05-02 09:45:00,333 - main - INFO - Included router: routers.aihub.router
2026-05-02 09:45:00,350 - main - INFO - Included router: routers.auth.router
2026-05-02 09:45:00,398 - main - INFO - Included router: routers.carts.router
2026-05-02 09:45:00,451 - main - INFO - Included router: routers.chat_analytics_daily.router
2026-05-02 09:45:00,498 - main - INFO - Included router: routers.chat_attachments.router
2026-05-02 09:45:00,580 - main - INFO - Included router: routers.chat_branding.router
2026-05-02 09:45:00,602 - main - INFO - Included router: routers.chat_branding_api.router
2026-05-02 09:45:00,748 - main - INFO - Included router: routers.chat_conversations.router
2026-05-02 09:45:00,792 - main - INFO - Included router: routers.chat_messages.router
2026-05-02 09:45:00,833 - main - INFO - Included router: routers.chat_routing_rules.router
2026-05-02 09:45:00,853 - main - INFO - Included router: routers.contact.router
2026-05-02 09:45:00,896 - main - INFO - Included router: routers.contact_inquiries.router
2026-05-02 09:45:00,940 - main - INFO - Included router: routers.ecom_checkout.router
2026-05-02 09:45:00,942 - main - INFO - Included router: routers.health.router
2026-05-02 09:45:00,984 - main - INFO - Included router: routers.kb_article_feedback.router
2026-05-02 09:45:01,026 - main - INFO - Included router: routers.kb_articles.router
2026-05-02 09:45:01,077 - main - INFO - Included router: routers.notification_preferences.router
2026-05-02 09:45:01,123 - main - INFO - Included router: routers.notifications.router
2026-05-02 09:45:01,127 - main - INFO - Included router: routers.notifications_extras.router
2026-05-02 09:45:01,235 - main - INFO - Included router: routers.oauth.router
2026-05-02 09:45:01,285 - main - INFO - Included router: routers.order_items.router
2026-05-02 09:45:01,475 - main - INFO - Included router: routers.orders.router
2026-05-02 09:45:01,548 - main - INFO - Included router: routers.plans.router
2026-05-02 09:45:01,599 - main - INFO - Included router: routers.product_categories.router
2026-05-02 09:45:01,654 - main - INFO - Included router: routers.product_reviews.router
2026-05-02 09:45:01,716 - main - INFO - Included router: routers.products.router
2026-05-02 09:45:01,741 - main - INFO - Included router: routers.role_management.router
2026-05-02 09:45:01,796 - main - INFO - Included router: routers.service_testimonials.router
2026-05-02 09:45:01,827 - main - INFO - Included router: routers.settings.router
2026-05-02 09:45:01,875 - main - INFO - Included router: routers.site_settings.router
2026-05-02 09:45:01,926 - main - INFO - Included router: routers.smtp_settings.router
2026-05-02 09:45:01,972 - main - INFO - Included router: routers.storage.router
2026-05-02 09:45:02,089 - main - INFO - Included router: routers.support_chat.router
2026-05-02 09:45:02,134 - main - INFO - Included router: routers.support_departments.router
2026-05-02 09:45:02,320 - main - INFO - Included router: routers.support_seats.router
2026-05-02 09:45:02,336 - main - INFO - Included router: routers.ticket_notifications_sync.router
2026-05-02 09:45:02,375 - main - INFO - Included router: routers.ticket_summaries.router
2026-05-02 09:45:02,419 - main - INFO - Included router: routers.ticket_sync_states.router
2026-05-02 09:45:02,431 - main - INFO - Included router: routers.user.router
2026-05-02 09:45:02,483 - main - INFO - Included router: routers.user_profiles.router
2026-05-02 09:45:02,522 - main - INFO - Included router: routers.user_roles.router
2026-05-02 09:45:02,542 - main - INFO - Included router: routers.whmcs.router
2026-05-02 09:45:02,613 - main - INFO - Included router: routers.whmcs_admin.router
2026-05-02 09:45:02,658 - main - INFO - Included router: routers.whmcs_extra.router
2026-05-02 09:45:02,659 - main - INFO - === Application startup initiated ===
2026-05-02 09:45:02,660 - services.database - INFO - Ignore creating tables
2026-05-02 09:45:02,660 - services.mock_data - INFO - Ignore initialize data
2026-05-02 09:45:02,661 - services.auth - INFO - Ignore initialize admin
2026-05-02 09:45:02,662 - main - INFO - === Application startup completed successfully ===
2026-05-02 09:45:22,483 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-05-02 09:45:22,484 - core.database - WARNING - Database session maker not available, attempting lazy initialization...
2026-05-02 09:45:22,484 - core.database - WARNING - Database not initialized, attempting lazy initialization...
2026-05-02 09:45:22,484 - core.database - INFO - Starting database initialization...
2026-05-02 09:45:22,484 - core.config - DEBUG - Read dynamic attribute database_url from environment variable DATABASE_URL
2026-05-02 09:45:22,484 - core.database - INFO - Normalizing database URL for async compatibility...
2026-05-02 09:45:22,486 - core.database - INFO - Creating async database engine...
2026-05-02 09:45:22,486 - core.database - INFO - Using QueuePool with connection pooling for non-Lambda environment
2026-05-02 09:45:22,534 - core.database - INFO - Database engine created successfully
2026-05-02 09:45:22,535 - core.database - INFO - Creating async session maker...
2026-05-02 09:45:22,535 - core.database - INFO - Async session maker created successfully
2026-05-02 09:45:22,535 - core.database - INFO - Database connection initialized successfully
2026-05-02 09:45:22,535 - core.database - DEBUG - [DB_OP] Starting create_tables
2026-05-02 09:45:22,535 - core.database - INFO - 🔧 Starting table creation...
2026-05-02 09:45:22,791 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-05-02 09:45:22,791 - core.database - DEBUG - [DB_OP] Database session created successfully in 0.0004s
2026-05-02 09:45:22,795 - dependencies.auth - DEBUG - Authentication required for request GET /api/v1/auth/me
2026-05-02 09:45:22,798 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-05-02 09:45:22,798 - core.database - DEBUG - [DB_OP] Database session created successfully in 0.0002s
2026-05-02 09:45:22,799 - routers.site_settings - DEBUG - Querying site_settingss: query={"key":"general"}, sort=None, skip=0, limit=1, fields=None
2026-05-02 09:45:22,801 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-05-02 09:45:22,801 - core.database - DEBUG - [DB_OP] Database session created successfully in 0.0002s
2026-05-02 09:45:22,802 - routers.site_settings - DEBUG - Querying site_settingss: query={"key":"branding"}, sort=None, skip=0, limit=1, fields=None
2026-05-02 09:45:23,411 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-05-02 09:45:23,412 - core.database - DEBUG - [DB_OP] Database session created successfully in 0.0004s
2026-05-02 09:45:23,412 - routers.auth - INFO - [token/exchange] Received platform token exchange request
2026-05-02 09:45:23,412 - core.config - DEBUG - Read dynamic attribute oidc_issuer_url from environment variable OIDC_ISSUER_URL
2026-05-02 09:45:23,412 - routers.auth - DEBUG - [token/exchange] Verifying token with issuer: https://auth.atoms.dev/api/v1/oidc/platform/tokens/verify
2026-05-02 09:45:26,001 - httpcore.connection - DEBUG - connect_tcp.started host='auth.atoms.dev' port=443 local_address=None timeout=5.0 socket_options=None
2026-05-02 09:45:26,015 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7facae0aca90>
2026-05-02 09:45:26,016 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x7facae09f9c0> server_hostname='auth.atoms.dev' timeout=5.0
2026-05-02 09:45:26,024 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7facae06e650>
2026-05-02 09:45:26,024 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2026-05-02 09:45:26,025 - httpcore.http11 - DEBUG - send_request_headers.complete
2026-05-02 09:45:26,025 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2026-05-02 09:45:26,026 - httpcore.http11 - DEBUG - send_request_body.complete
2026-05-02 09:45:26,026 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2026-05-02 09:45:26,055 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Sat, 02 May 2026 16:45:26 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'ce1e6df8cb0224c0dfbefce708883215'), (b'cf-cache-status', b'DYNAMIC'), (b'Content-Encoding', b'gzip'), (b'Server', b'cloudflare'), (b'CF-RAY', b'9f587f0dab3fd7af-LAX')])
2026-05-02 09:45:26,056 - httpx - INFO - HTTP Request: POST https://auth.atoms.dev/api/v1/oidc/platform/tokens/verify "HTTP/1.1 200 OK"
2026-05-02 09:45:26,056 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2026-05-02 09:45:26,057 - httpcore.http11 - DEBUG - receive_response_body.complete
2026-05-02 09:45:26,057 - httpcore.http11 - DEBUG - response_closed.started
2026-05-02 09:45:26,057 - httpcore.http11 - DEBUG - response_closed.complete
2026-05-02 09:45:26,058 - httpcore.connection - DEBUG - close.started
2026-05-02 09:45:26,058 - httpcore.connection - DEBUG - close.complete
2026-05-02 09:45:26,059 - routers.auth - DEBUG - [token/exchange] Issuer response status: 200
2026-05-02 09:45:26,059 - routers.auth - DEBUG - [token/exchange] Issuer response body: {'success': True, 'data': {'exp': 1780324675, 'user_id': 1085530, 'email': 'toom3003@gmail.com', 'pv': 1}, 'message': 'Platform token verified', 'code': 0, 'timestamp': '2026-05-02T16:45:26.050764'}
2026-05-02 09:45:26,060 - routers.auth - INFO - [token/exchange] Token verified, platform_user_id=1085530, email=toom3003@gmail.com
2026-05-02 09:45:26,060 - core.config - DEBUG - Read dynamic attribute admin_user_id from environment variable ADMIN_USER_ID
2026-05-02 09:45:26,060 - routers.auth - INFO - [token/exchange] User verified: platform_user_id=1085530, role=admin
2026-05-02 09:45:26,092 - routers.auth - DEBUG - [token/exchange] User object for token issuance: id=1085530, email=toom3003@gmail.com, role=admin
2026-05-02 09:45:26,093 - core.config - DEBUG - Read dynamic attribute jwt_expire_minutes from environment variable JWT_EXPIRE_MINUTES
2026-05-02 09:45:26,093 - core.config - DEBUG - Read dynamic attribute jwt_secret_key from environment variable JWT_SECRET_KEY
2026-05-02 09:45:26,093 - core.config - DEBUG - Read dynamic attribute jwt_algorithm from environment variable JWT_ALGORITHM
2026-05-02 09:45:26,387 - core.auth - DEBUG - Authentication token created for user hash: 4f820a44
2026-05-02 09:45:26,388 - routers.auth - INFO - [token/exchange] Token issued successfully for user_id=1085530, expires_at=2026-06-01 16:45:26.093319+00:00
2026-05-02 09:45:26,389 - core.database - DEBUG - [DB_OP] Database session cleanup after 2.9773s
2026-05-02 09:45:26,715 - core.database - DEBUG - [DB_OP] Database session cleanup after 3.9239s
2026-05-02 09:45:26,840 - routers.site_settings - DEBUG - Found 0 site_settingss
2026-05-02 09:45:26,841 - core.database - DEBUG - [DB_OP] Database session cleanup after 4.0432s
2026-05-02 09:45:26,842 - routers.site_settings - DEBUG - Found 0 site_settingss
2026-05-02 09:45:26,842 - core.database - DEBUG - [DB_OP] Database session cleanup after 4.0414s
2026-05-02 09:45:28,766 - core.database - INFO - Tables initialized successfully
2026-05-02 09:45:28,767 - core.database - DEBUG - [DB_OP] Create tables completed in 6.2318s
2026-05-02 09:45:28,831 - core.database - INFO - Lazy database initialization completed successfully
2026-05-02 09:45:28,831 - core.database - DEBUG - [DB_OP] Database session created successfully in 6.3481s
2026-05-02 09:45:28,832 - routers.auth - INFO - [token/exchange] Received platform token exchange request
2026-05-02 09:45:28,832 - routers.auth - DEBUG - [token/exchange] Verifying token with issuer: https://auth.atoms.dev/api/v1/oidc/platform/tokens/verify
2026-05-02 09:45:28,856 - httpcore.connection - DEBUG - connect_tcp.started host='auth.atoms.dev' port=443 local_address=None timeout=5.0 socket_options=None
2026-05-02 09:45:28,873 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7facae0ad750>
2026-05-02 09:45:28,874 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x7facadff28c0> server_hostname='auth.atoms.dev' timeout=5.0
2026-05-02 09:45:28,884 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7facae0ad330>
2026-05-02 09:45:28,884 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2026-05-02 09:45:28,885 - httpcore.http11 - DEBUG - send_request_headers.complete
2026-05-02 09:45:28,885 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2026-05-02 09:45:28,885 - httpcore.http11 - DEBUG - send_request_body.complete
2026-05-02 09:45:28,886 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2026-05-02 09:45:28,917 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Sat, 02 May 2026 16:45:28 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'fd214d2a704ef994cc0afc94a3c516bd'), (b'cf-cache-status', b'DYNAMIC'), (b'Content-Encoding', b'gzip'), (b'Server', b'cloudflare'), (b'CF-RAY', b'9f587f1f8c6cf8cf-LAX')])
2026-05-02 09:45:28,918 - httpx - INFO - HTTP Request: POST https://auth.atoms.dev/api/v1/oidc/platform/tokens/verify "HTTP/1.1 200 OK"
2026-05-02 09:45:28,918 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2026-05-02 09:45:28,918 - httpcore.http11 - DEBUG - receive_response_body.complete
2026-05-02 09:45:28,919 - httpcore.http11 - DEBUG - response_closed.started
2026-05-02 09:45:28,919 - httpcore.http11 - DEBUG - response_closed.complete
2026-05-02 09:45:28,919 - httpcore.connection - DEBUG - close.started
2026-05-02 09:45:28,920 - httpcore.connection - DEBUG - close.complete
2026-05-02 09:45:28,920 - routers.auth - DEBUG - [token/exchange] Issuer response status: 200
2026-05-02 09:45:28,920 - routers.auth - DEBUG - [token/exchange] Issuer response body: {'success': True, 'data': {'exp': 1780324675, 'user_id': 1085530, 'email': 'toom3003@gmail.com', 'pv': 1}, 'message': 'Platform token verified', 'code': 0, 'timestamp': '2026-05-02T16:45:28.913473'}
2026-05-02 09:45:28,920 - routers.auth - INFO - [token/exchange] Token verified, platform_user_id=1085530, email=toom3003@gmail.com
2026-05-02 09:45:28,920 - routers.auth - INFO - [token/exchange] User verified: platform_user_id=1085530, role=admin
2026-05-02 09:45:28,920 - routers.auth - DEBUG - [token/exchange] User object for token issuance: id=1085530, email=toom3003@gmail.com, role=admin
2026-05-02 09:45:28,921 - core.auth - DEBUG - Authentication token created for user hash: 4f820a44
2026-05-02 09:45:28,922 - routers.auth - INFO - [token/exchange] Token issued successfully for user_id=1085530, expires_at=2026-06-01 16:45:28.921274+00:00
2026-05-02 09:45:28,922 - core.database - DEBUG - [DB_OP] Database session cleanup after 6.4389s
2026-05-02 09:46:21,820 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-05-02 09:46:21,820 - core.database - DEBUG - [DB_OP] Database session created successfully in 0.0004s
2026-05-02 09:46:21,824 - dependencies.auth - DEBUG - Authentication required for request GET /api/v1/auth/me
2026-05-02 09:46:21,828 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-05-02 09:46:21,828 - core.database - DEBUG - [DB_OP] Database session created successfully in 0.0003s
2026-05-02 09:46:21,828 - routers.site_settings - DEBUG - Querying site_settingss: query={"key":"general"}, sort=None, skip=0, limit=1, fields=None
2026-05-02 09:46:21,830 - core.database - DEBUG - [DB_OP] Starting get_db session creation
2026-05-02 09:46:21,830 - core.database - DEBUG - [DB_OP] Database session created successfully in 0.0002s
2026-05-02 09:46:21,830 - routers.site_settings - DEBUG - Querying site_settingss: query={"key":"branding"}, sort=None, skip=0, limit=1, fields=None
2026-05-02 09:46:22,206 - core.database - DEBUG - [DB_OP] Database session cleanup after 0.3859s
2026-05-02 09:46:22,273 - routers.site_settings - DEBUG - Found 0 site_settingss
2026-05-02 09:46:22,273 - core.database - DEBUG - [DB_OP] Database session cleanup after 0.4458s
2026-05-02 09:46:22,274 - routers.site_settings - DEBUG - Found 0 site_settingss
2026-05-02 09:46:22,274 - core.database - DEBUG - [DB_OP] Database session cleanup after 0.4443s
2026-05-02 09:46:57,938 - services.database - DEBUG - [DB_OP] Starting database close
2026-05-02 09:46:58,204 - core.database - INFO - Database connection closed and engine disposed
2026-05-02 09:46:58,204 - services.database - INFO - Database connections closed
2026-05-02 09:46:58,205 - services.database - DEBUG - [DB_OP] Database close completed in 0.2665s
