Waiting for environment to be ready. It can take a few minutes

Hi @nolive
I am checking the local domain with curl and below is the result.

curl -I http://kf.kobo.local/health/
HTTP/1.1 502 Bad Gateway
Server: nginx
Date: Mon, 07 Oct 2024 04:47:37 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 150
Connection: keep-alive

curl -I -H ‘Host: komoml.xxxx.com’ -H ‘X-Forwarded-Proto: https’ http://kf.kobo.local/
HTTP/1.1 204 No Content
Server: nginx
Date: Mon, 07 Oct 2024 05:10:23 GMT
Connection: keep-alive

This is the.run.conf file. I removed the credentials from it.

{
“advanced”: false,
“aws_access_key”: “”,
“aws_backup_bucket_deletion_rule_enabled”: false,
“aws_backup_bucket_name”: “”,
“aws_backup_daily_retention”: “30”,
“aws_backup_monthly_retention”: “12”,
“aws_backup_upload_chunk_size”: “15”,
“aws_backup_weekly_retention”: “4”,
“aws_backup_yearly_retention”: “2”,
“aws_bucket_name”: “”,
“aws_credentials_valid”: false,
“aws_mongo_backup_minimum_size”: “50”,
“aws_postgres_backup_minimum_size”: “50”,
“aws_redis_backup_minimum_size”: “5”,
“aws_s3_region_name”: “us-east-1”,
“aws_secret_key”: “”,
“aws_validate_credentials”: true,
“block_common_http_ports”: true,
“compose_version”: “v1”,
“custom_secret_keys”: false,
“customized_ports”: false,
“date_created”: 1727936472,
“date_modified”: 1727936490,
“debug”: false,
“default_from_email”: “support@kobo.local”,
“dev_mode”: false,
“django_secret_key”: “0e72a3bda2af766c6b9231174952b65b1e2581950cb5da2102821ccc066fba2559c907f9d25580fb0976b212fd7bfb390093”,
“django_session_cookie_age”: 604800,
“docker_prefix”: “”,
“ee_subdomain”: “ee”,
“enketo_api_token”: “4e199a9d59bb75778ccf3a05068ef2b2832b3845261918530279dba195d4637e5fba3f06370b565a218b97d37b35b1de2372d1a7b16b9f5cbf0da5e6”,
“enketo_encryption_key”: “30e3ddb5c08d3efce6164f12a3b46bade38fa35b6346f28863bffac8bde495cbe33f7828a2d34fddd5ef1ff120e3fc112880e940d25108f91a7a8d0c”,
“enketo_less_secure_encryption_key”: “this $3cr3t key is crackable”,
“expose_backend_ports”: false,
“exposed_nginx_docker_port”: “80”,
“google_api_key”: “”,
“google_ua”: “”,
“https”: false,
“internal_domain_name”: “docker.internal”,
“kc_dev_build_id”: “”,
“kc_postgres_db”: “fieldmasterkc”,
“kc_subdomain”: “kc”,
“kobocat_media_backup_schedule”: “0 0 * * 0”,
“kobocat_raven”: “”,
“kobodocker_path”: “/media/rajeesh-techv/New_Volume11/kobotoolbox-test/kobo-docker”,
“kpi_dev_build_id”: “”,
“kpi_path”: “”,
“kpi_postgres_db”: “fieldmasterkf”,
“kpi_raven”: “”,
“kpi_raven_js”: “”,
“kpi_subdomain”: “kf”,
“letsencrypt_email”: “support@kobo.local”,
“local_installation”: true,
“local_interface”: “eno1”,
“local_interface_ip”: “192.168.1.161”,
“maintenance_date_iso”: “”,
“maintenance_date_str”: “”,
“maintenance_email”: “support@kobo.local”,
“maintenance_enabled”: false,
“maintenance_eta”: “2 hours”,
“mongo_backup_schedule”: “0 1 * * 0”,
“mongo_port”: “27017”,
“mongo_root_password”: “",
“mongo_root_username”: “root”,
“mongo_secured”: true,
“mongo_user_password”: "
”,
“mongo_user_username”: “kobo”,
“multi”: false,
“nginx_proxy_port”: “80”,
“npm_container”: true,
“postgres_backup_schedule”: “0 2 * * 0”,
“postgres_cpus”: “1”,
“postgres_hard_drive_type”: “hdd”,
“postgres_max_connections”: “100”,
“postgres_password”: “"
“postgres_profile”: “Mixed”,
“postgres_ram”: “2”,
“postgres_replication_password”: "
”,
“postgres_settings”: false,
“postgres_settings_content”: “# Generated by PGConfig 3.1.0 (1d600ea0d1d79f13dd7ed686f9e2befc1fcf9226)\n# https://api.pgconfig.org/v1/tuning/get-config?format=conf&include_pgbadger=false&max_connections=100&pg_version=14&environment_name=Mixed&total_ram=2GB&cpus=1&drive_type=SSD&os_type=linux\n\n# Memory Configuration\nshared_buffers = 256MB\neffective_cache_size = 768MB\nwork_mem = 2MB\nmaintenance_work_mem = 51MB\n\n# Checkpoint Related Configuration\nmin_wal_size = 2GB\nmax_wal_size = 3GB\ncheckpoint_completion_target = 0.9\nwal_buffers = -1\n\n# Network Related Configuration\nlisten_addresses = ''\nmax_connections = 100\n\n# Storage Configuration\nrandom_page_cost = 1.1\neffective_io_concurrency = 200\n\n# Worker Processes Configuration\nmax_worker_processes = 8\nmax_parallel_workers_per_gather = 2\nmax_parallel_workers = 2\n\n",
“postgres_user”: “kobo”,
“postgresql_port”: “5432”,
“primary_backend_ip”: “192.168.1.161”,
“private_domain_name”: “kobo.private”,
“proxy”: false,
“public_domain_name”: “kobo.local”,
“raven_settings”: false,
“redis_backup_schedule”: “0 3 * * 0”,
“redis_cache_max_memory”: “”,
“redis_cache_port”: “6380”,
“redis_main_port”: “6379”,
“redis_password”: "
”,
“review_host”: true,
“server_role”: “frontend”,
“service_account_whitelisted_hosts”: true,
“smtp_host”: “”,
“smtp_password”: “”,
“smtp_port”: “25”,
“smtp_use_tls”: false,
“smtp_user”: “”,
“staging_mode”: false,
“super_user_password”: “*”,
“super_user_username”: “super_admin”,
“two_databases”: true,
“unique_id”: 1727936463,
“use_aws”: false,
“use_backend_custom_yml”: false,
“use_backup”: false,
“use_booleans_v4”: true,
“use_celery”: true,
“use_frontend_custom_yml”: false,
“use_letsencrypt”: false,
“use_private_dns”: false,
“use_wal_e”: false,
“uwsgi_harakiri”: “120”,
“uwsgi_max_requests”: “1024”,
“uwsgi_settings”: false,
“uwsgi_soft_limit”: “1024”,
“uwsgi_worker_reload_mercy”: “120”,
“uwsgi_workers_max”: “4”,
“uwsgi_workers_start”: “2”
}
Could you provide me with your valuable guidance?

Hi @OlivierL

This is kpi log

sudo docker logs kobofe_kpi_1
KPI initializing…
Waiting for container mongo.
wait-for-it: waiting 40 seconds for mongo.kobo.private:27017
wait-for-it: mongo.kobo.private:27017 is available after 0 seconds
Container mongo up.
Waiting for container postgres.
wait-for-it: waiting 20 seconds for postgres.kobo.private:5432
wait-for-it: postgres.kobo.private:5432 is available after 0 seconds
Container postgres up.
Waiting for Postgres service.
postgres.kobo.private:5432 - accepting connections
Postgres service running; ensuring fieldmasterkf database exists and has PostGIS extensions…
ERROR: database “fieldmasterkf” already exists
You are now connected to database “fieldmasterkf” as user “kobo”.
NOTICE: extension “postgis” already exists, skipping
CREATE EXTENSION
NOTICE: extension “postgis_topology” already exists, skipping
CREATE EXTENSION
NOTICE: extension “fuzzystrmatch” already exists, skipping
CREATE EXTENSION
NOTICE: extension “postgis_tiger_geocoder” already exists, skipping
CREATE EXTENSION
Postgres database fieldmasterkf ready for use!
Postgres service running; ensuring fieldmasterkc database exists and has PostGIS extensions…
ERROR: database “fieldmasterkc” already exists
You are now connected to database “fieldmasterkc” as user “kobo”.
NOTICE: extension “postgis” already exists, skipping
CREATE EXTENSION
CREATE EXTENSION
NOTICE: extension “postgis_topology” already exists, skipping
CREATE EXTENSION
NOTICE: extension “fuzzystrmatch” already exists, skipping
NOTICE: extension “postgis_tiger_geocoder” already exists, skipping
CREATE EXTENSION
Postgres database fieldmasterkc ready for use!
Running migrations…
Traceback (most recent call last):
File “/srv/src/kpi/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line
utility.execute()
File “/opt/venv/lib/python3.10/site-packages/django/core/management/init.py”, line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/email_notifications.py”, line 65, in run_from_argv
super().run_from_argv(argv)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 412, in run_from_argv
Exception while running run() in ‘scripts.fix_migrations_for_kobocat_django_app’
self.execute(*args, **cmd_options)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/email_notifications.py”, line 77, in execute
super().execute(*args, **options)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 458, in execute
output = self.handle(*args, **options)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/utils.py”, line 62, in inner
ret = func(self, *args, **kwargs)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/commands/runscript.py”, line 281, in handle
run_script(script_mod, *script_args)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/commands/runscript.py”, line 159, in run_script
exit_code = mod.run(*script_args)
File “/srv/src/kpi/scripts/fix_migrations_for_kobocat_django_app.py”, line 9, in run
if migrate_custom_user_model():
File “/srv/src/kpi/scripts/fix_migrations_for_kobocat_django_app.py”, line 80, in migrate_custom_user_model
raise Exception(‘Run ./manage.py migrate auth first’)
Exception: Run ./manage.py migrate auth first

This log is showing after I tried to migrate, but I found an issue below.

oot@2544e198ac26:/srv/src/kpi# python manage.py migrate --database=kobocat
WARNING:root:MONGO_DB_URL is not found. KPI_MONGO_HOST, KPI_MONGO_PORT, KPI_MONGO_NAME, KPI_MONGO_USER, KPI_MONGO_PASS are deprecated and will not be supported anymore soon.
Traceback (most recent call last):
File “/opt/venv/lib/python3.10/site-packages/asgiref/local.py”, line 89, in _lock_storage
asyncio.get_running_loop()
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/venv/lib/python3.10/site-packages/django/utils/connection.py”, line 58, in getitem
return getattr(self._connections, alias)
File “/opt/venv/lib/python3.10/site-packages/asgiref/local.py”, line 118, in getattr
return getattr(storage, key)
AttributeError: ‘_thread._local’ object has no attribute ‘kobocat’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/src/kpi/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line
utility.execute()
File “/opt/venv/lib/python3.10/site-packages/django/core/management/init.py”, line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 412, in run_from_argv
self.execute(*args, **cmd_options)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 458, in execute
output = self.handle(*args, **options)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 106, in wrapper
res = handle_func(*args, **kwargs)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py”, line 100, in handle
self.check(databases=[database])
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 485, in check
all_issues = checks.run_checks(
File “/opt/venv/lib/python3.10/site-packages/django/core/checks/registry.py”, line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File “/opt/venv/lib/python3.10/site-packages/django/core/checks/database.py”, line 12, in check_database_backends
conn = connections[alias]
File “/opt/venv/lib/python3.10/site-packages/django/utils/connection.py”, line 61, in getitem
raise self.exception_class(f"The connection ‘{alias}’ doesn’t exist.")
django.utils.connection.ConnectionDoesNotExist: The connection ‘kobocat’ doesn’t exist.

Please help me.

Hi @OlivierL

Thanks for the guidance. After trying the first steps
Try this first:
Stop your front-end containers, ./run.py -cf stop
Enter a one off KPI container with ./run.py -cf run --rm kpi bash.
Then inside the container.

./manage migrate auth 

given below, an error occurred.

root@kpi:/srv/src/kpi# python manage.py migrate
Traceback (most recent call last):
File “/srv/src/kpi/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line
utility.execute()
File “/opt/venv/lib/python3.10/site-packages/django/core/management/init.py”, line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 412, in run_from_argv
self.execute(*args, **cmd_options)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 458, in execute
output = self.handle(*args, **options)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 106, in wrapper
res = handle_func(*args, **kwargs)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py”, line 120, in handle
executor.loader.check_consistent_history(connection)
File “/opt/venv/lib/python3.10/site-packages/django/db/migrations/loader.py”, line 327, in check_consistent_history
raise InconsistentMigrationHistory(
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration auth.0003_alter_user_email_max_length is applied before its dependency auth.0002_alter_permission_name_max_length on database ‘default’.

The second option you gave was also tried, but the same KPI log was found below the log.

If it does not work, try to downgrade the version of KoboToolbox first.

./run.py --stop 
./run.py --upgrade 2.024.19d (answer questions)
# wait for containers to be up...  
./run.py --stop 
./run.py --auto-upgrade 2.024.25c 
./run.py 

docker logs kobofe_kpi_1
KPI initializing…
Waiting for container mongo.
wait-for-it: waiting 40 seconds for mongo.kobo.private:27017
wait-for-it: mongo.kobo.private:27017 is available after 0 seconds
Container mongo up.
Waiting for container postgres.
wait-for-it: waiting 20 seconds for postgres.kobo.private:5432
wait-for-it: postgres.kobo.private:5432 is available after 1 seconds
Container postgres up.
Waiting for Postgres service.
postgres.kobo.private:5432 - accepting connections
Postgres service running; ensuring fieldmasterkf database exists and has PostGIS extensions…
ERROR: database “fieldmasterkf” already exists
You are now connected to database “fieldmasterkf” as user “kobo”.
NOTICE: extension “postgis” already exists, skipping
CREATE EXTENSION
NOTICE: extension “postgis_topology” already exists, skipping
CREATE EXTENSION
NOTICE: extension “fuzzystrmatch” already exists, skipping
CREATE EXTENSION
NOTICE: extension “postgis_tiger_geocoder” already exists, skipping
CREATE EXTENSION
Postgres database fieldmasterkf ready for use!
Postgres service running; ensuring fieldmasterkc database exists and has PostGIS extensions…
ERROR: database “fieldmasterkc” already exists
You are now connected to database “fieldmasterkc” as user “kobo”.
NOTICE: extension “postgis” already exists, skipping
CREATE EXTENSION
NOTICE: extension “postgis_topology” already exists, skipping
CREATE EXTENSION
NOTICE: extension “fuzzystrmatch” already exists, skipping
CREATE EXTENSION
NOTICE: extension “postgis_tiger_geocoder” already exists, skipping
CREATE EXTENSION
Postgres database fieldmasterkc ready for use!
Running migrations…
Traceback (most recent call last):
File “/srv/src/kpi/manage.py”, line 10, in
Exception while running run() in ‘scripts.fix_migrations_for_kobocat_django_app’
execute_from_command_line(sys.argv)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line
utility.execute()
File “/opt/venv/lib/python3.10/site-packages/django/core/management/init.py”, line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/email_notifications.py”, line 65, in run_from_argv
super().run_from_argv(argv)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 412, in run_from_argv
self.execute(*args, **cmd_options)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/email_notifications.py”, line 77, in execute
super().execute(*args, **options)
File “/opt/venv/lib/python3.10/site-packages/django/core/management/base.py”, line 458, in execute
output = self.handle(*args, **options)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/utils.py”, line 62, in inner
ret = func(self, *args, **kwargs)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/commands/runscript.py”, line 281, in handle
run_script(script_mod, *script_args)
File “/opt/venv/lib/python3.10/site-packages/django_extensions/management/commands/runscript.py”, line 159, in run_script
exit_code = mod.run(*script_args)
File “/srv/src/kpi/scripts/fix_migrations_for_kobocat_django_app.py”, line 9, in run
if migrate_custom_user_model():
File “/srv/src/kpi/scripts/fix_migrations_for_kobocat_django_app.py”, line 80, in migrate_custom_user_model
raise Exception(‘Run ./manage.py migrate auth first’)
Exception: Run ./manage.py migrate auth first

""Hi, @Rejeesh , you cannot upgrade direct since your instance is older than 2.022.44

You have to follow the [upgrade process] as is, (kobo-docker/doc/November-2022-Upgrade.md at master · kobotoolbox/kobo-docker · GitHub"“”

I have followed the suggested steps to upgrade PostgreSQL and have also completed the MongoDB upgrade. Everything is working, and the database has been upgraded without any bugs. The final step is to run.py, but I am encountering a runtime error. its code broken.

Created a new version of KoboToolbox and plan to attach my old Vols backup this have full conversantion and screenshots.

After that, I will locally test with an upgraded dump file. However, we are currently facing problems with Django migration. I need my VMWare DB upgrade and code to work; otherwise, I need to localize it. Which option is easier to resolve? Please help me

@Rejeesh,

Try to downgrade to 2.024.19d like I said. Then run ./manage.py migrate auth from the KPI container. When it’s done (inside the KPI container), run ./manage.py showmigrations and ensure that all migrations under [auth] are checked. The last one should be 0012_alter_user_first_name_max_length .

auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length
 [X] 0004_alter_user_username_opts
 [X] 0005_alter_user_last_login_null
 [X] 0006_require_contenttypes_0002
 [X] 0007_alter_validators_add_error_messages
 [X] 0008_alter_user_username_max_length
 [X] 0009_alter_user_last_name_max_length
 [X] 0010_alter_group_name_max_length
 [X] 0011_update_proxy_permissions
 [X] 0012_alter_user_first_name_max_length

If it is not the case, there is something uncommon with your environment. Otherwise, you should be able to upgrade to 2.024.25b after those steps.

1 Like

Oops, just saw the detail we were missing.

It seems that 0003 is already applied in your database, but 0002 is not.

I don’t know it’s possible but Django is complaining about it.
You need to compare what in table django_migrations

koboform=# select * from django_migrations where app='auth';
 id | app  |                   name                   |            applied
----+------+------------------------------------------+-------------------------------
  2 | auth | 0001_initial                             | 2022-11-09 15:35:20.636969+00
  8 | auth | 0002_alter_permission_name_max_length    | 2022-11-09 15:35:20.93422+00
  9 | auth | 0003_alter_user_email_max_length         | 2022-11-09 15:35:20.944691+00
 10 | auth | 0004_alter_user_username_opts            | 2022-11-09 15:35:20.952643+00
 11 | auth | 0005_alter_user_last_login_null          | 2022-11-09 15:35:20.960958+00
 12 | auth | 0006_require_contenttypes_0002           | 2022-11-09 15:35:20.964359+00
 13 | auth | 0007_alter_validators_add_error_messages | 2022-11-09 15:35:20.97094+00
 14 | auth | 0008_alter_user_username_max_length      | 2022-11-09 15:35:21.009886+00
 15 | auth | 0009_alter_user_last_name_max_length     | 2022-11-09 15:35:21.017666+00
 16 | auth | 0010_alter_group_name_max_length         | 2022-11-09 15:35:21.029149+00
 17 | auth | 0011_update_proxy_permissions            | 2022-11-09 15:35:21.069596+00
 18 | auth | 0012_alter_user_first_name_max_length    | 2022-11-09 15:35:21.078178+00

In column name you should have a sequence from 0001 to 0012. If some of them are missing (and I would still not know why), you can add entries manually in the table and let think django the migration has been applied correctly. You have to do the same in KoboCAT database. Just fill the holes, do not add missing entries over your last one. (For example, if your last one if 0006 , do not add 0007 to 0012. Django will do it with ./manage.py migrate auth. Only add what’s missing between 0001 and 0006.

Keep in mind, you will have to run ./manage,py migrate auth from KPI and KoboCAT containers if you are under 2.024.19d or ./manage.py migrate auth and ./manage.py migrate auth --database kobocat from KPI container under 2.024.25b.

Unfortunately, the state of the database would be out-of-sync with Django. You will to fix it manually.

2 Likes

HI @OlivierL

I have followed the suggested steps to upgrade PostgreSQL and have also completed the MongoDB upgrade. Everything is working, and the database has been upgraded without any bugs. But the Kobo installation is also an old version, so according to the documentation, ““upgrading from an old version of Kobo-Docker””. The final step is to install Python3 and run it. This is after I encountered a broken code. These steps are fine right?. Please. Help me resolve this issue. Please give me your suggestions. I think the easiest way to upgrade my application without any issues is to use this method.

HI @OlivierL

We have installed version 2.024.19d, which is a build version created on my local system. After upgrading, we restored the SQL database in PostgreSQL. However, we faced the same issue as before, experiencing a 600 sec wait …

We have carefully checked your guidelines step by step and attached the results in the screenshot. In our opinion, the migration should be acceptable, but it appears not to be. We suspect that using HTTP instead of HTTPS might be the issue.



Could you please provide guidance on what we should troubleshoot next? Your valuable advice would be greatly appreciated.

It is not the same issue. You have issues with your migrations before. And now it seems that they are ok.

Look at /service_health/ endpoint and see if it returns something.
Look at nginx logs, look at kpi logs. if everything seems ok, it is definitively something wrong with the DNS settings. Ensure, you can access the domain name from your host .

1 Like

Hi @OlivierL
Thank you now its working fine!

1 Like

Hi @OlivierL

We have successfully restored the database. However, the data inside the groups/photos section is not visible, and the submissions are stuck in a loop. The photos that are displayed when clicking the “eye” button are visible, but the issue persists with the submission loop.

we have checked kobo-local/myfiles/kpi/jsapp/js/components/submissions/table.es6

In get media attatchment the questionXPath is getting undefined. In the table.es6 file the function getMediaAttachment is called with parameters,
if (q.type !== QUESTION_TYPES.text.id) {
mediaAttachment = getMediaAttachment(
row.original,
row.value,
q.$xpath
);
}
but the q.$xpath is undefined cuz there is no property called $xpath in the object q.


We think some validations have not been passed and are undefined. Could you please give me valuable guidance?