[flask-app assets 4/6] RUN npm ci:
1.315 npm ERR! code EUSAGE
1.317 npm ERR!
1.318 npm ERR! Thenpm cicommand can only install with an existing package-lock.json or
1.318 npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
1.319 npm ERR! later to generate a package-lock.json file, then try again.
1.322 npm ERR!
1.322 npm ERR! Clean install a project
1.322 npm ERR!
1.323 npm ERR! Usage:
1.323 npm ERR! npm ci
1.324 npm ERR!
1.325 npm ERR! Options:
1.325 npm ERR! [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
1.325 npm ERR! [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
1.325 npm ERR! [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit]
1.325 npm ERR! [--no-bin-links] [--no-fund] [--dry-run]
1.325 npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
1.325 npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
1.325 npm ERR!
1.325 npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
1.325 npm ERR!
1.325 npm ERR! Run "npm help ci" for more info
1.329
1.329 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2025-02-03T02_15_38_601Z-debug-0.log
failed to solve: process "/bin/sh -c npm ci" did not complete successfully: exit code: 1
make sure to fix this error and make sure mycode node js in application
Now, let's ensure we have a proper package.json file:
To rebuild and start your Docker containers, run the following commands:
docker-compose down
docker-compose up --build -dThis should resolve the Node.js-related error and ensure that all necessary environment variables are set. The application should now build successfully with Node.js integration.
If you encounter any other issues or need further assistance, please let me know.
celery-worker-1 | Usage: celery [OPTIONS] COMMAND [ARGS]...
celery-worker-1 | Try 'celery --help' for help.
celery-worker-1 |
celery-worker-1 | Error: Invalid value for '-A' / '--app':
celery-worker-1 | Unable to load celery application.
celery-worker-1 | While trying to load the module app.tasks.celery the following error occurred:
celery-worker-1 | Traceback (most recent call last):
celery-worker-1 | File "/home/python/.local/lib/python3.13/site-packages/celery/bin/celery.py", line 58, in convert
celery-worker-1 | return find_app(value)
celery-worker-1 | File "/home/python/.local/lib/python3.13/site-packages/celery/app/utils.py", line 383, in find_app
celery-worker-1 | sym = symbol_by_name(app, imp=imp)
celery-worker-1 | File "/home/python/.local/lib/python3.13/site-packages/kombu/utils/imports.py", line 59, in symbol_by_name
celery-worker-1 | module = imp(module_name, package=package, **kwargs)
celery-worker-1 | File "/home/python/.local/lib/python3.13/site-packages/celery/utils/imports.py", line 109, in import_from_cwd
celery-worker-1 | return imp(module, package=package)
celery-worker-1 | File "/usr/local/lib/python3.13/importlib/init.py", line 88, in import_module
celery-worker-1 | return _bootstrap._gcd_import(name[level:], package, level)
celery-worker-1 | ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
celery-worker-1 | File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
celery-worker-1 | File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
celery-worker-1 | File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
celery-worker-1 | File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
celery-worker-1 | File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
celery-worker-1 | File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
celery-worker-1 | File "/app/app/tasks.py", line 5, in <module>
celery-worker-1 | app = create_app()
celery-worker-1 | File "/app/app/init.py", line 17, in create_app
celery-worker-1 | app.config.from_object('app.config.Config')
celery-worker-1 | ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
celery-worker-1 | File "/home/python/.local/lib/python3.13/site-packages/flask/config.py", line 251, in from_object
celery-worker-1 | obj = import_string(obj)
celery-worker-1 | File "/home/python/.local/lib/python3.13/site-packages/werkzeug/utils.py", line 612, in import_string
celery-worker-1 | raise ImportStringError(import_name, e).with_traceback(
celery-worker-1 | sys.exc_info()[2]
celery-worker-1 | ) from None
celery-worker-1 | File "/home/python/.local/lib/python3.13/site-packages/werkzeug/utils.py", line 604, in import_string
celery-worker-1 | module = import(module_name, globals(), locals(), [obj_name])
celery-worker-1 | werkzeug.utils.ImportStringError: import_string() failed for 'app.config.Config'. Possible reasons are:
celery-worker-1 |
celery-worker-1 | - missing init.py in a package;
celery-worker-1 | - package or module path not included in sys.path;
celery-worker-1 | - duplicated package or module name taking precedence in sys.path;
celery-worker-1 | - missing module, class, function or variable;
celery-worker-1 |
celery-worker-1 | Debugged import:
celery-worker-1 |
celery-worker-1 | - 'app' found in '/app/app/init.py'.
celery-worker-1 | - 'app.config' not found.
celery-worker-1 |
celery-worker-1 | Original exception:
celery-worker-1 |
celery-worker-1 | ModuleNotFoundError: No module named 'app.config'
celery-worker-1 |
elasticsearch-1 | {"@timestamp":"2025-02-03T02:18:54.556Z", "log.level": "INFO", "message":"Authentication of [kibana_system] was terminated by realm [reserved] - failed to authenticate user [kibana_system]", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[2e8d25251c67][transport_worker][T#6]","log.logger":"org.elasticsearch.xpack.security.authc.RealmsAuthenticator","trace.id":"1eda552c7e72b69af5edd08c457c9fd2","elasticsearch.cluster.uuid":"5mnNebnORNyxWqqYBs9VpQ","elasticsearch.node.id":"kXg2qu1ARJmytLNW1zzcug","elasticsearch.node.name":"2e8d25251c67","elasticsearch.cluster.name":"docker-cluster"}
db-1 | 2025-02-03 02:18:54.712 UTC [44] LOG: invalid length of startup packet
grafana-1 | logger=context userId=0 orgId=0 uname= t=2025-02-03T02:18:54.774339332Z level=info msg= error="[auth.unauthorized] cannot authenticate request" remote_addr=172.18.0.1 traceID=
grafana-1 | logger=context userId=0 orgId=0 uname= t=2025-02-03T02:18:54.776539261Z level=info msg="Request Completed" method=GET path=/api/live/ws status=401 remote_addr=172.18.0.1 time_ms=2 duration=2.273211ms size=102 referer= handler=/api/live/ws
fix all these error and make updation dont change the other things
Let's address these issues one by one:
app.config.Config module. Let's create this missing configuration file.Now, let's update the Celery worker configuration in the docker-compose.yml file:
Now, let's update the .env file to ensure all necessary environment variables are set:
Finally, let's update the app/init.py file to ensure it's using the new config:
These changes should resolve the errors you're experiencing. To apply these changes:
docker-compose down
docker-compose up --build -dThis should fix the Celery worker error, the Elasticsearch authentication issue, and the Grafana configuration problem while maintaining the existing structure and functionality of your application.
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.668+00:00][INFO ][plugins-service] Plugin "securitySolutionServerless" is disabled.
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.668+00:00][INFO ][plugins-service] Plugin "serverless" is disabled.
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.668+00:00][INFO ][plugins-service] Plugin "serverlessObservability" is disabled.
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.668+00:00][INFO ][plugins-service] Plugin "serverlessSearch" is disabled.
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.675+00:00][INFO ][plugins-service] Plugin "sessionView" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [timelines]
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.745+00:00][INFO ][plugins-service] Plugin "synthetics" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [cases, fleet, exploratoryView, observability, observabilityShared, observabilityAIAssistant, security]
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.752+00:00][INFO ][plugins-service] Plugin "threatIntelligence" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [cases]
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.758+00:00][INFO ][plugins-service] Plugin "timelines" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [cases]
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.814+00:00][INFO ][plugins-service] Plugin "uptime" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [cases, fleet, exploratoryView, observability, observabilityShared, observabilityAIAssistant, security]
2025-02-03 11:57:53 kibana-1 | [2025-02-03T06:27:53.901+00:00][INFO ][plugins-service] Plugin "ux" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [exploratoryView, observabilityShared, observabilityAIAssistant, apm]
2025-02-03 11:57:54 kibana-1 | [2025-02-03T06:27:54.027+00:00][INFO ][http.server.Preboot] http server running at http://0.0.0.0:5601
2025-02-03 11:57:54 kibana-1 | [2025-02-03T06:27:54.337+00:00][INFO ][plugins-system.preboot] Setting up [1] plugins: [interactiveSetup]
2025-02-03 11:57:54 kibana-1 | [2025-02-03T06:27:54.886+00:00][INFO ][plugins-system.standard] Setting up [123] plugins: [devTools,translations,share,screenshotMode,usageCollection,telemetryCollectionManager,telemetryCollectionXpack,taskManager,kibanaUsageCollection,files,cloud,newsfeed,savedObjectsFinder,noDataPage,monitoringCollection,metricsDataAccess,licensing,mapsEms,globalSearch,globalSearchProviders,features,guidedOnboarding,banners,licenseApiGuard,customBranding,ftrApis,fieldFormats,expressions,screenshotting,esUiShared,encryptedSavedObjects,customIntegrations,contentManagement,dataViews,home,telemetry,searchprofiler,painlessLab,management,spaces,lists,eventLog,actions,notifications,snapshotRestore,logstash,licenseManagement,indexManagement,remoteClusters,crossClusterReplication,indexLifecycleManagement,cloudDataMigration,advancedSettings,grokdebugger,console,bfetch,data,upgradeAssistant,savedObjectsTagging,savedObjectsManagement,unifiedSearch,graph,alerting,embeddable,uiActionsEnhanced,savedSearch,presentationUtil,expressionShape,expressionRevealImage,expressionRepeatImage,expressionMetric,expressionImage,controls,rollup,fileUpload,ingestPipelines,ecsDataQualityDashboard,dataViewFieldEditor,dataViewManagement,charts,watcher,visualizations,visTypeXy,visTypeVislib,visTypeVega,visTypeTimeseries,visTypeTimelion,visTypeTagcloud,visTypeTable,visTypeMetric,visTypeMarkdown,visTypeHeatmap,inputControlVis,expressionTagcloud,expressionPartitionVis,visTypePie,expressionMetricVis,expressionLegacyMetricVis,expressionHeatmap,expressionGauge,visTypeGauge,eventAnnotation,expressionXY,dashboard,triggersActionsUi,transform,stackConnectors,stackAlerts,ruleRegistry,links,lens,maps,discover,reporting,canvas,discoverEnhanced,dataVisualizer,aiops,ml,elasticAssistant,dashboardEnhanced,apmDataAccess,assetManager]
2025-02-03 11:57:54 kibana-1 | [2025-02-03T06:27:54.904+00:00][INFO ][plugins.taskManager] TaskManager is identified by the Kibana UUID: b75db251-44c4-4d49-be15-9e91ac77d178
2025-02-03 11:57:54 kibana-1 | [2025-02-03T06:27:54.956+00:00][INFO ][custom-branding-service] CustomBrandingService registering plugin: customBranding
2025-02-03 11:57:54 kibana-1 | [2025-02-03T06:27:54.989+00:00][WARN ][plugins.encryptedSavedObjects] Saved objects encryption key is not set. This will severely limit Kibana functionality. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.114+00:00][WARN ][plugins.actions] APIs are disabled because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.155+00:00][INFO ][plugins.notifications] Email Service Error: Email connector not specified.
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.391+00:00][INFO ][plugins.alerting] using indexes and aliases for persisting alerts
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.396+00:00][WARN ][plugins.alerting] APIs are disabled because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.792+00:00][INFO ][plugins.alerting] Registering resources for context "stack".
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.841+00:00][WARN ][plugins.reporting.config] Generating a random key for xpack.reporting.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.reporting.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command.
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.844+00:00][WARN ][plugins.reporting.config] Found 'server.host: "0.0.0.0"' in Kibana configuration. Reporting is not able to use this as the Kibana server hostname. To enable PNG/PDF Reporting to work, 'xpack.reporting.kibanaServer.hostname: localhost' is automatically set in the configuration. You can prevent this message by adding 'xpack.reporting.kibanaServer.hostname: localhost' in kibana.yml.
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.915+00:00][INFO ][plugins.alerting] Registering resources for context "ml.anomaly-detection".
2025-02-03 11:57:55 kibana-1 | [2025-02-03T06:27:55.924+00:00][INFO ][plugins.assetManager] Server is NOT enabled
2025-02-03 11:57:56 kibana-1 | [2025-02-03T06:27:56.083+00:00][WARN ][plugins.screenshotting.config] Chromium sandbox provides an additional layer of protection, but is not supported for Linux Ubuntu 20.04 OS. Automatically setting 'xpack.screenshotting.browser.chromium.disableSandbox: true'.
2025-02-03 11:57:56 kibana-1 | [2025-02-03T06:27:56.181+00:00][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. security_exception
2025-02-03 11:57:56 kibana-1 | Root causes:
2025-02-03 11:57:56 kibana-1 | security_exception: unable to authenticate user [kibana_system] for REST request [/_nodes?filter_path=nodes..version%2Cnodes..http.publish_address%2Cnodes.*.ip]
2025-02-03 11:57:56 kibana-1 | [2025-02-03T06:27:56.313+00:00][INFO ][plugins.screenshotting.chromium] Browser executable: /usr/share/kibana/node_modules/@kbn/screenshotting-plugin/chromium/headless_shell-linux_x64/headless_shell