diff --git a/ChangeLog.d/bugfix/ZBX-26818 b/ChangeLog.d/bugfix/ZBX-26818
new file mode 100644
index 00000000000..db577171f88
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-26818
@@ -0,0 +1 @@
+.......PS. [ZBX-26818] fixed crash on \"cannot get secrets for path\" error due to missing lock when using shared memory (vso)
diff --git a/src/libs/zbxcacheconfig/dbconfig.c b/src/libs/zbxcacheconfig/dbconfig.c
index 15312af63af..401e9bc6afd 100644
--- a/src/libs/zbxcacheconfig/dbconfig.c
+++ b/src/libs/zbxcacheconfig/dbconfig.c
@@ -230,12 +230,28 @@ void	set_dc_config(zbx_dc_config_t *in)
 }
 
 static zbx_rwlock_t	config_lock = ZBX_RWLOCK_NULL;
+static int		wlock_is_locked;
 
 zbx_rwlock_t	zbx_get_config_lock(void)
 {
 	return config_lock;
 }
 
+int	zbx_config_wlock_is_locked(void)
+{
+	return wlock_is_locked;
+}
+
+void	zbx_config_wlock_set_locked(void)
+{
+	wlock_is_locked = 1;
+}
+
+void	zbx_config_wlock_set_unlocked(void)
+{
+	wlock_is_locked = 0;
+}
+
 static zbx_rwlock_t	config_history_lock = ZBX_RWLOCK_NULL;
 
 zbx_rwlock_t	zbx_get_config_history_lock(void)
@@ -919,6 +935,9 @@ const char	*dc_strpool_intern(const char *str)
 	zbx_uint32_t	*refcount;
 	size_t		size;
 
+	if (0 == zbx_config_wlock_is_locked())
+		THIS_SHOULD_NEVER_HAPPEN;
+
 	if (NULL == str)
 		return NULL;
 
@@ -936,6 +955,9 @@ void	dc_strpool_release(const char *str)
 {
 	zbx_uint32_t	*refcount;
 
+	if (0 == zbx_config_wlock_is_locked())
+		THIS_SHOULD_NEVER_HAPPEN;
+
 	refcount = (zbx_uint32_t *)(str - REFCOUNT_FIELD_SIZE);
 	if (0 == --(*refcount))
 		zbx_hashset_remove(&config->strpool, str - REFCOUNT_FIELD_SIZE);
@@ -945,6 +967,9 @@ const char	*dc_strpool_acquire(const char *str)
 {
 	zbx_uint32_t	*refcount;
 
+	if (0 == zbx_config_wlock_is_locked())
+		THIS_SHOULD_NEVER_HAPPEN;
+
 	if (NULL == str)
 		return NULL;
 
@@ -956,7 +981,10 @@ const char	*dc_strpool_acquire(const char *str)
 
 int	dc_strpool_replace(int found, const char **curr, const char *new_str)
 {
-	if (1 == found)
+	if (0 == zbx_config_wlock_is_locked())
+		THIS_SHOULD_NEVER_HAPPEN;
+
+	if (1 == found && NULL != *curr)
 	{
 		if (0 == strcmp(*curr, new_str))
 			return FAIL;
@@ -2246,7 +2274,7 @@ void	zbx_dc_sync_kvs_paths(const struct zbx_json_parse *jp_kvs_paths, const zbx_
 		else if (FAIL == zbx_vault_kvs_get(dc_kvs_path->path, &kvs, config_vault, config_source_ip,
 				config_ssl_ca_location, config_ssl_cert_location, config_ssl_key_location, &error))
 		{
-			zabbix_log(LOG_LEVEL_WARNING, "cannot get secrets for path \"%s\": %s", dc_kvs_path->path,
+			zabbix_log(LOG_LEVEL_WARNING, "cannot get secrets for path \"%s\": %s",	dc_kvs_path->path,
 					error);
 			zbx_free(error);
 			continue;
@@ -3725,6 +3753,9 @@ static void	DCsync_items(zbx_dbsync_t *sync, zbx_uint64_t revision, int flags, z
 		if (0 != found && ITEM_TYPE_SNMPTRAP == item->type)
 			dc_interface_snmpitems_remove(item);
 
+		if (NULL == row[5])
+			zabbix_log(LOG_LEVEL_WARNING, "invalid null key for itemid:" ZBX_FS_UI64, itemid);
+
 		/* see whether we should and can update items_hk index at this point */
 
 		if (0 == found || 0 != strcmp(item->key, row[5]))
@@ -3739,7 +3770,9 @@ static void	DCsync_items(zbx_dbsync_t *sync, zbx_uint64_t revision, int flags, z
 				{
 					/* item keys should be unique for items within a host, otherwise items with  */
 					/* same key share index and removal of last added item already cleared index */
-					THIS_SHOULD_NEVER_HAPPEN;
+					zabbix_log(LOG_LEVEL_WARNING, "duplicate key '%s' new key '%s' removed for"
+							" itemid:" ZBX_FS_UI64, item->key, ZBX_NULL2STR(row[5]),
+							itemid);
 				}
 				else if (item == item_hk->item_ptr)
 				{
@@ -4182,6 +4215,9 @@ static void	DCsync_triggers(zbx_dbsync_t *sync, zbx_uint64_t revision)
 		if (ZBX_FLAG_DISCOVERY_PROTOTYPE == trigger->flags)
 			continue;
 
+		if (NULL == row[2] || NULL == row[11])
+			zabbix_log(LOG_LEVEL_WARNING, "invalid null expression for triggerid:" ZBX_FS_UI64, triggerid);
+
 		dc_strpool_replace(found, &trigger->description, row[1]);
 		dc_strpool_replace(found, &trigger->expression, row[2]);
 		dc_strpool_replace(found, &trigger->recovery_expression, row[11]);
@@ -5885,6 +5921,11 @@ static void	DCsync_item_tags(zbx_dbsync_t *sync)
 			index = item->tags.values_num - 1;
 		}
 
+		if (NULL == row[2] || NULL == row[3])
+		{
+			zabbix_log(LOG_LEVEL_WARNING, "invalid null tag for itemtagid:" ZBX_FS_UI64,
+					item_tag_local.itemtagid);
+		}
 		dc_strpool_replace(found, &item->tags.values[index].tag, row[2]);
 		dc_strpool_replace(found, &item->tags.values[index].value, row[3]);
 	}
diff --git a/src/libs/zbxcacheconfig/dbconfig.h b/src/libs/zbxcacheconfig/dbconfig.h
index 4a46d2d1cdc..41c6cfeec1f 100644
--- a/src/libs/zbxcacheconfig/dbconfig.h
+++ b/src/libs/zbxcacheconfig/dbconfig.h
@@ -1076,10 +1076,38 @@ void	set_dc_config(zbx_dc_config_t *in);
 
 int		zbx_get_sync_in_progress(void);
 zbx_rwlock_t	zbx_get_config_lock(void);
-
-#define	RDLOCK_CACHE	do { if (0 == zbx_get_sync_in_progress()) zbx_rwlock_rdlock(zbx_get_config_lock()); } while(0)
-#define	WRLOCK_CACHE	do { if (0 == zbx_get_sync_in_progress()) zbx_rwlock_wrlock(zbx_get_config_lock()); } while(0)
-#define	UNLOCK_CACHE	do { if (0 == zbx_get_sync_in_progress()) zbx_rwlock_unlock(zbx_get_config_lock()); } while(0)
+int		zbx_config_wlock_is_locked(void);
+void		zbx_config_wlock_set_locked(void);
+void		zbx_config_wlock_set_unlocked(void);
+
+#define	RDLOCK_CACHE	do								\
+			{								\
+				if (0 == zbx_get_sync_in_progress())			\
+				{							\
+					zbx_rwlock_rdlock(zbx_get_config_lock());	\
+				}							\
+			}								\
+			while(0)
+
+#define	WRLOCK_CACHE	do								\
+			{								\
+				if (0 == zbx_get_sync_in_progress())			\
+				{							\
+					zbx_rwlock_wrlock(zbx_get_config_lock());	\
+					zbx_config_wlock_set_locked();			\
+				}							\
+			}								\
+			while(0)
+
+#define	UNLOCK_CACHE	do								\
+			{								\
+				if (0 == zbx_get_sync_in_progress())			\
+				{							\
+					zbx_config_wlock_set_unlocked();		\
+					zbx_rwlock_unlock(zbx_get_config_lock());	\
+				}							\
+			}								\
+			while(0)
 
 zbx_rwlock_t	zbx_get_config_history_lock(void);
 
diff --git a/src/libs/zbxeval/misc.c b/src/libs/zbxeval/misc.c
index 4f1a2aeede7..b0220023b15 100644
--- a/src/libs/zbxeval/misc.c
+++ b/src/libs/zbxeval/misc.c
@@ -99,7 +99,7 @@ static void	serialize_variant(unsigned char **buffer, size_t *size, const zbx_va
 	}
 }
 
-static zbx_uint32_t	deserialize_variant(const unsigned char *ptr,  zbx_variant_t *value)
+static zbx_uint32_t	deserialize_variant(const unsigned char *ptr, zbx_variant_t *value, int *ret)
 {
 	const unsigned char	*start = ptr;
 	unsigned char		type;
@@ -115,10 +115,12 @@ static zbx_uint32_t	deserialize_variant(const unsigned char *ptr,  zbx_variant_t
 		case ZBX_VARIANT_UI64:
 			ptr += zbx_deserialize_uint64(ptr, &ui64);
 			zbx_variant_set_ui64(value, ui64);
+			THIS_SHOULD_NEVER_HAPPEN_MSG("unexpected type:%d", type);
 			break;
 		case ZBX_VARIANT_DBL:
 			ptr += zbx_deserialize_double(ptr, &dbl);
 			zbx_variant_set_dbl(value, dbl);
+			THIS_SHOULD_NEVER_HAPPEN_MSG("unexpected type:%d", type);
 			break;
 		case ZBX_VARIANT_STR:
 			len = strlen((const char *)ptr) + 1;
@@ -131,7 +133,8 @@ static zbx_uint32_t	deserialize_variant(const unsigned char *ptr,  zbx_variant_t
 			zbx_variant_set_none(value);
 			break;
 		default:
-			THIS_SHOULD_NEVER_HAPPEN;
+			*ret = FAIL;
+			THIS_SHOULD_NEVER_HAPPEN_MSG("unknown type:%d", type);
 			zbx_variant_set_none(value);
 			break;
 	}
@@ -200,6 +203,44 @@ size_t	zbx_eval_serialize(const zbx_eval_context_t *ctx, zbx_mem_malloc_func_t m
 	return len + len_offset;
 }
 
+static void	zbx_eval_deserialize_dump(zbx_eval_context_t *ctx, const char *expression,
+		const unsigned char *start, const unsigned char *end, zbx_uint32_t len, zbx_uint32_t tokens_num)
+{
+	zbx_uint32_t	i, data_num = end - start;
+
+	zabbix_log(LOG_LEVEL_WARNING, "len:%u tokens_num:%u data len:%u", len, tokens_num, data_num);
+	zabbix_log(LOG_LEVEL_WARNING, "expression '%s'", expression);
+
+#define ZBX_DATA_DUMP_SIZE 1024
+	char		*buffer = NULL;
+	size_t		buffer_alloc = ZBX_DATA_DUMP_SIZE * 4 + 32, buffer_offset = 0;
+
+	if (ZBX_DATA_DUMP_SIZE < data_num)
+		data_num = ZBX_DATA_DUMP_SIZE;
+
+	buffer = (char *)zbx_malloc(NULL, buffer_alloc);
+
+	for (i = 0; i < data_num; i++)
+	{
+		if (0 != i)
+			zbx_strcpy_alloc(&buffer, &buffer_alloc, &buffer_offset, (0 == (i & 7) ? " | " : " "));
+
+		zbx_snprintf_alloc(&buffer, &buffer_alloc, &buffer_offset, "%02x", (int)start[i]);
+	}
+
+	(buffer)[buffer_offset] = '\0';
+
+	zabbix_log(LOG_LEVEL_WARNING, "data:%s", buffer);
+	zbx_free(buffer);
+
+	char	*new_expression = NULL;
+	zbx_eval_compose_expression(ctx, &new_expression);
+
+	zabbix_log(LOG_LEVEL_WARNING, "new expression '%s'", new_expression);
+
+	zbx_free(new_expression);
+}
+
 /******************************************************************************
  *                                                                            *
  * Purpose: deserializes evaluation context from buffer                       *
@@ -214,7 +255,9 @@ size_t	zbx_eval_serialize(const zbx_eval_context_t *ctx, zbx_mem_malloc_func_t m
 void	zbx_eval_deserialize(zbx_eval_context_t *ctx, const char *expression, zbx_uint64_t rules,
 		const unsigned char *data)
 {
-	zbx_uint32_t	i, tokens_num, len, pos;
+	zbx_uint32_t		i, tokens_num, len, pos;
+	int			ret = SUCCEED;
+	const unsigned char	*start = data;
 
 	memset(ctx, 0, sizeof(zbx_eval_context_t));
 	ctx->expression = expression;
@@ -238,8 +281,11 @@ void	zbx_eval_deserialize(zbx_eval_context_t *ctx, const char *expression, zbx_u
 		data += zbx_deserialize_uint31_compact(data, &pos);
 		token->loc.r = pos;
 
-		data += deserialize_variant(data, &token->value);
+		data += deserialize_variant(data, &token->value, &ret);
 	}
+
+	if (FAIL == ret)
+		zbx_eval_deserialize_dump(ctx, expression, start, data, len, tokens_num);
 }
 
 int	zbx_eval_compare_tokens_by_loc(const void *d1, const void *d2)
diff --git a/src/libs/zbxscripts/scripts.c b/src/libs/zbxscripts/scripts.c
index 73591500eda..8280ce67cd9 100644
--- a/src/libs/zbxscripts/scripts.c
+++ b/src/libs/zbxscripts/scripts.c
@@ -35,6 +35,7 @@
 #include "zbxjson.h"
 #include "zbxstr.h"
 #include "zbxinterface.h"
+#include "zbxtime.h"
 
 #define REMOTE_COMMAND_NEW		0
 #define REMOTE_COMMAND_RESULT_OOM	1
