iisnode encountered an error when processing the request.

HRESULT: 0x6d
HTTP status: 500
HTTP subStatus: 1013
HTTP reason: Internal Server Error

You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

The last 64k of the output generated by the node.exe process to stderr is shown below:

(node:20940) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
sql query execution error:

DECLARE @trg TABLE (uuid uniqueidentifier);

WITH src AS (
    SELECT [uuid], [product_id], [buy_price], [sell_price], [sell_price2], [sell_price3], [discount], [commission1], [commission2], [sku], [sku_prefix], [sku_suffix], [barcode], [option1_id], [option_value1_id], [option2_id], [option_value2_id], [min_purchase_quantity], [max_purchase_quantity], [changed_at], [sync_ver], [is_deleted] FROM [productvariation] AS src
    WHERE owner='A232CCBC-BBBA-4464-ACAE-CF81C8595DB5' AND sync_ver>0
)

SELECT (
    SELECT * FROM src
    WHERE
        sync_ver>1733930269443
        AND is_deleted = 0
        AND NOT EXISTS (SELECT uuid FROM @trg AS trg WHERE src.uuid=trg.uuid)
    FOR JSON AUTO, INCLUDE_NULL_VALUES)
AS [new_to_client]
,
(SELECT (
    SELECT uuid FROM src
    WHERE
        sync_ver>1733930269443
        AND is_deleted = 1
    FOR JSON AUTO, INCLUDE_NULL_VALUES)
) AS [deleted]
,
(SELECT IIF(OBJECT_ID('tempdb..##MissingPKs') IS NULL, NULL, (
    SELECT [column], [value] FROM ##MissingPKs
    WHERE [table]='productvariation' AND owner='A232CCBC-BBBA-4464-ACAE-CF81C8595DB5'
    FOR JSON AUTO, INCLUDE_NULL_VALUES)
)) AS [missing_pks_in_server]
,
(SELECT
    LOWER(CONVERT(VARCHAR(32),HASHBYTES('MD5', LOWER((
        SELECT uuid, changed_at, sync_ver FROM src
        WHERE is_deleted=0
        ORDER BY convert(nvarchar(36), uuid)
        FOR JSON AUTO, INCLUDE_NULL_VALUES)
    )), 2))
) AS [checksum]

{"code":"EREQUEST","originalError":{"sqlstate":"42S02","code":208,"severity":16,"serverName":"SERVER-WIN","procName":"","lineNumber":4},"name":"RequestError","number":208,"lineNumber":4,"state":"42S02","class":16,"serverName":"SERVER-WIN","procName":""}
sql query execution error:

DECLARE @trg TABLE (uuid uniqueidentifier);

WITH src AS (
    SELECT [uuid], [name], [parent_directory], [created_at], [tags], [media_id], [changed_at], [sync_ver], [is_deleted] FROM [directory] AS src
    WHERE owner='97F40886-2D72-49C9-BAA1-B29FB6634A95' AND sync_ver>0
)

SELECT (
    SELECT * FROM src
    WHERE
        sync_ver>1733927409011
        AND is_deleted = 0
        AND NOT EXISTS (SELECT uuid FROM @trg AS trg WHERE src.uuid=trg.uuid)
    FOR JSON AUTO, INCLUDE_NULL_VALUES)
AS [new_to_client]
,
(SELECT (
    SELECT uuid FROM src
    WHERE
        sync_ver>1733927409011
        AND is_deleted = 1
    FOR JSON AUTO, INCLUDE_NULL_VALUES)
) AS [deleted]
,
(SELECT IIF(OBJECT_ID('tempdb..##MissingPKs') IS NULL, NULL, (
    SELECT [column], [value] FROM ##MissingPKs
    WHERE [table]='directory' AND owner='97F40886-2D72-49C9-BAA1-B29FB6634A95'
    FOR JSON AUTO, INCLUDE_NULL_VALUES)
)) AS [missing_pks_in_server]
,
(SELECT
    LOWER(CONVERT(VARCHAR(32),HASHBYTES('MD5', LOWER((
        SELECT uuid, changed_at, sync_ver FROM src
        WHERE is_deleted=0
        ORDER BY convert(nvarchar(36), uuid)
        FOR JSON AUTO, INCLUDE_NULL_VALUES)
    )), 2))
) AS [checksum]

{"code":"EREQUEST","originalError":{"sqlstate":"42S02","code":208,"severity":16,"serverName":"SERVER-WIN","procName":"","lineNumber":4},"name":"RequestError","number":208,"lineNumber":4,"state":"42S02","class":16,"serverName":"SERVER-WIN","procName":""}
failed to udpate any row of <Media>
failed to udpate any row of <WebshopCart>
failed to udpate any row of <WebshopCart>
failed to udpate any row of <Media>
failed to udpate any row of <Media>
sql query execution error:

            SELECT DISTINCT prd.brand
            FROM Product prd
            INNER JOIN V_Directory_Path dirPath ON dirPath.directory_id = prd.directory_id
            INNER JOIN F_Product_Stock_For_Webshop(N'B5A65D5D-CBBB-445F-8CF8-63052E024DC5') prdStock ON prd.uuid = prdStock.product_id
            WHERE prd.is_deleted = 0
                AND prd.active_for_webshop=1
                AND prd.is_archived=0
                AND prd.owner = N'B5A65D5D-CBBB-445F-8CF8-63052E024DC5'
                AND prd.brand IS NOT NULL
                AND prdStock._stock > 0
                AND dirPath.directory_path like '%/466F8192-CA02-4FCE-8E4A-5428B3ACC643%'
        
{"code":"EREQUEST","originalError":{"sqlstate":"HYT00","code":0,"severity":0,"serverName":"","procName":"","lineNumber":0},"name":"RequestError","number":0,"lineNumber":0,"state":"HYT00","class":0,"serverName":"","procName":""}
unhandledRejection: RequestError: Query timeout expired