cap-js / sdm

CAP Plugin for SAP Document Management service
Apache License 2.0
11 stars 2 forks source link

Cannot read properties of undefined (reading 'succinctProperties') #76

Closed ejazsyed closed 1 week ago

ejazsyed commented 2 weeks ago

Hi Team,

I am trying out DMS implementation on top if incident management application as described in step https://github.com/cap-js/sdm . However after. i try to save the uploaded pdf , i am getting below error

image

services.cds

image

package.json

image

Below are the error logs of my CAP application.

Relevant log output


 2024-10-11T09:47:50.25+0000 [APP/PROC/WEB/0] ERR {"level":"error","logger":"cds","correlation_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","tenant_id":"e70f5ec3-f3eb-47e7-b1d7-aa5e8a342208","host":"referenceapps-hadr-validation-bf23fbzw-acceptance-incid2a5a56e3.cfapps.eu10-004.hana.ondemand.com","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","content_length":"1122","request_size_b":"1122","accept":"multipart/mixed","accept_encoding":"gzip, deflate, br, zstd","accept_language":"en","authorization":"***","b3":"67271ebfa8d645294bc48740453656f0-4bc48740453656f0","content_type":"multipart/mixed; boundary=batch_id-1728640068978-540","cookie":"***","mime_version":"1.0","odata_maxversion":"4.0","odata_version":"4.0","origin":"https://hadr-validation-bf23fbzw.launchpad.cfapps.eu10.hana.ondemand.com","priority":"u=1, i","referer":"https://hadr-validation-bf23fbzw.launchpad.cfapps.eu10.hana.ondemand.com/cp.portal/ui5appruntime.html?siteId=b8ce149b-cfd3-4def-91f2-256afad54d4d&subaccountId=e70f5ec3-f3eb-47e7-b1d7-aa5e8a342208&saasApprouter=true&sap-ui-app-id=ns.incidents&scenario=LAUNCHPAD&sap-startup-params=&sap-shell=FLP&sap-touch=0&sap-ui-versionedLibCss=true&sap-plugins=RTAPluginAgent&sap-history-dir=NewEntry&sap-personalization=true&sap-theme=sap_horizon&sap-locale=en&sap-propagate-async-loading=true&sap-iframe-hint=UI5","sec_ch_ua":"\"Not)A;Brand\";v=\"99\", \"Google Chrome\";v=\"127\", \"Chromium\";v=\"127\"","sec_ch_ua_mobile":"?0","sec_ch_ua_platform":"\"macOS\"","sec_fetch_dest":"empty","sec_fetch_mode":"cors","sec_fetch_site":"same-origin","tenant_host_pattern":"(^(.*)(?=-sapdelim-([^\\.]*)(\\.m)?\\.launchpad(?:\\.v1)?\\.cfapps\\.eu10\\.hana\\.ondemand\\.com)|^([^\\.]*)(?=(\\.m)?\\.launchpad(?:\\.v1)?\\.cfapps\\.eu10\\.hana\\.ondemand\\.com)|^(.*)(?=-sapdelim-([^\\.]*)(\\.m)?\\.eu10\\.start\\.cloud\\.sap)|^([^\\.]*)(?=(\\.m)?\\.eu10\\.start\\.cloud\\.sap)|^(.*)(?=-sapdelim-([^\\.]*)(\\.m)?\\.eu10\\.workzone\\.cloud\\.sap)|^([^\\.]*)(?=(\\.m)?\\.eu10\\.workzone\\.cloud\\.sap))","tenantid":"sapportalservices!hadr-validation-bf23fbzw","traceparent":"00-2e34217c63034fd3f4bb16a1eb9e6778-1fdd575a8dd4bfc7-01","w3c_traceparent":"00-2e34217c63034fd3f4bb16a1eb9e6778-1fdd575a8dd4bfc7-01","tracestate":"8cc0df6a-69d2b3b0@dt=fw4;1;3b8e474c;20cfe;0;0;0;2b9;212b;2h01;3h3b8e474c;4h020cfe;5h01","x_attribute_scenario":"launchpad","x_b3_spanid":"4bc48740453656f0","x_b3_traceid":"67271ebfa8d645294bc48740453656f0","x_cf_applicationid":"d6e5f463-015b-4627-9961-ad75ffd021a7","x_cf_instanceid":"521f5282-7948-418f-7206-b443","x_cf_instanceindex":"0","x_correlationid":"67271ebf-a8d6-4529-4bc4-8740453656f0","x_csrf_token":"Fetch","x_dynatrace":"FW4;1775416240;1;999180108;134398;0;-1933516950;697;212b;2h01;3h3b8e474c;4h020cfe;5h01","x_dynatrace_application":"v=2;appId=ea7c4b59f27d43eb;cookieDomain=ondemand.com;rid=131732609;rpid=-1062245879;en=fq285rcp","x_forwarded_for":"165.1.238.38, 10.0.200.9, 18.195.244.40, 10.0.136.0","x_forwarded_host":"hadr-validation-bf23fbzw.launchpad.cfapps.eu10.hana.ondemand.com","x_forwarded_path":"/54c6c32b-57b0-4309-ae85-8e39d33fe926.incidents.nsincidents/~d1e693f7-3e05-4845-bcb8-ebbb41c794dc~/odata/v4/processor/$batch","x_forwarded_proto":"https","x_request_start":"1728640069130","x_requested_with":"XMLHttpRequest","x_scp_request_id":"1537b968-2194-40d5-97d9-4c50b6d88af4-6708F444-6317C18","x_sf_correlation_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","x_vcap_request_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","request_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","x_correlation_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","timestamp":"2024-10-11T09:47:50.249Z","msg":"Cannot read properties of undefined (reading 'succinctProperties')","stacktrace":["TypeError: Cannot read properties of undefined (reading 'succinctProperties')","at SDMAttachmentsService.getParentId (/home/vcap/app/node_modules/@cap-js/sdm/lib/sdm.js:182:34)","at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","at async SDMAttachmentsService.create (/home/vcap/app/node_modules/@cap-js/sdm/lib/sdm.js:120:20)","at async SDMAttachmentsService.draftSaveHandler (/home/vcap/app/node_modules/@cap-js/sdm/lib/sdm.js:96:25)","at async Promise.all (index 3)","at async ProcessorService.handle (/home/vcap/app/node_modules/@sap/cds/lib/srv/srv-dispatch.js:59:5)","at async ProcessorService.handle (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/common/Service.js:84:16)","at async cds.ApplicationService.handle (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js:605:20)"],"layer":"cds","component_type":"application","container_id":"10.0.201.37","component_id":"d6e5f463-015b-4627-9961-ad75ffd021a7","component_name":"incident-management-srv","component_instance":0,"source_instance":0,"organization_name":"referenceapps_hadr-validation-bf23fbzw","organization_id":"e383ed10-dd89-42b0-a28f-b9d4103cc194","space_name":"acceptance","space_id":"d014c282-bc64-4280-824b-1e908a8f5845","type":"log"}
   2024-10-11T09:47:50.25+0000 [APP/PROC/WEB/0] ERR {"level":"error","logger":"error","correlation_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","tenant_id":"e70f5ec3-f3eb-47e7-b1d7-aa5e8a342208","host":"referenceapps-hadr-validation-bf23fbzw-acceptance-incid2a5a56e3.cfapps.eu10-004.hana.ondemand.com","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","content_length":"1122","request_size_b":"1122","accept":"multipart/mixed","accept_encoding":"gzip, deflate, br, zstd","accept_language":"en","authorization":"***","b3":"67271ebfa8d645294bc48740453656f0-4bc48740453656f0","content_type":"multipart/mixed; boundary=batch_id-1728640068978-540","cookie":"***","mime_version":"1.0","odata_maxversion":"4.0","odata_version":"4.0","origin":"https://hadr-validation-bf23fbzw.launchpad.cfapps.eu10.hana.ondemand.com","priority":"u=1, i","referer":"https://hadr-validation-bf23fbzw.launchpad.cfapps.eu10.hana.ondemand.com/cp.portal/ui5appruntime.html?siteId=b8ce149b-cfd3-4def-91f2-256afad54d4d&subaccountId=e70f5ec3-f3eb-47e7-b1d7-aa5e8a342208&saasApprouter=true&sap-ui-app-id=ns.incidents&scenario=LAUNCHPAD&sap-startup-params=&sap-shell=FLP&sap-touch=0&sap-ui-versionedLibCss=true&sap-plugins=RTAPluginAgent&sap-history-dir=NewEntry&sap-personalization=true&sap-theme=sap_horizon&sap-locale=en&sap-propagate-async-loading=true&sap-iframe-hint=UI5","sec_ch_ua":"\"Not)A;Brand\";v=\"99\", \"Google Chrome\";v=\"127\", \"Chromium\";v=\"127\"","sec_ch_ua_mobile":"?0","sec_ch_ua_platform":"\"macOS\"","sec_fetch_dest":"empty","sec_fetch_mode":"cors","sec_fetch_site":"same-origin","tenant_host_pattern":"(^(.*)(?=-sapdelim-([^\\.]*)(\\.m)?\\.launchpad(?:\\.v1)?\\.cfapps\\.eu10\\.hana\\.ondemand\\.com)|^([^\\.]*)(?=(\\.m)?\\.launchpad(?:\\.v1)?\\.cfapps\\.eu10\\.hana\\.ondemand\\.com)|^(.*)(?=-sapdelim-([^\\.]*)(\\.m)?\\.eu10\\.start\\.cloud\\.sap)|^([^\\.]*)(?=(\\.m)?\\.eu10\\.start\\.cloud\\.sap)|^(.*)(?=-sapdelim-([^\\.]*)(\\.m)?\\.eu10\\.workzone\\.cloud\\.sap)|^([^\\.]*)(?=(\\.m)?\\.eu10\\.workzone\\.cloud\\.sap))","tenantid":"sapportalservices!hadr-validation-bf23fbzw","traceparent":"00-2e34217c63034fd3f4bb16a1eb9e6778-1fdd575a8dd4bfc7-01","w3c_traceparent":"00-2e34217c63034fd3f4bb16a1eb9e6778-1fdd575a8dd4bfc7-01","tracestate":"8cc0df6a-69d2b3b0@dt=fw4;1;3b8e474c;20cfe;0;0;0;2b9;212b;2h01;3h3b8e474c;4h020cfe;5h01","x_attribute_scenario":"launchpad","x_b3_spanid":"4bc48740453656f0","x_b3_traceid":"67271ebfa8d645294bc48740453656f0","x_cf_applicationid":"d6e5f463-015b-4627-9961-ad75ffd021a7","x_cf_instanceid":"521f5282-7948-418f-7206-b443","x_cf_instanceindex":"0","x_correlationid":"67271ebf-a8d6-4529-4bc4-8740453656f0","x_csrf_token":"Fetch","x_dynatrace":"FW4;1775416240;1;999180108;134398;0;-1933516950;697;212b;2h01;3h3b8e474c;4h020cfe;5h01","x_dynatrace_application":"v=2;appId=ea7c4b59f27d43eb;cookieDomain=ondemand.com;rid=131732609;rpid=-1062245879;en=fq285rcp","x_forwarded_for":"165.1.238.38, 10.0.200.9, 18.195.244.40, 10.0.136.0","x_forwarded_host":"hadr-validation-bf23fbzw.launchpad.cfapps.eu10.hana.ondemand.com","x_forwarded_path":"/54c6c32b-57b0-4309-ae85-8e39d33fe926.incidents.nsincidents/~d1e693f7-3e05-4845-bcb8-ebbb41c794dc~/odata/v4/processor/$batch","x_forwarded_proto":"https","x_request_start":"1728640069130","x_requested_with":"XMLHttpRequest","x_scp_request_id":"1537b968-2194-40d5-97d9-4c50b6d88af4-6708F444-6317C18","x_sf_correlation_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","x_vcap_request_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","request_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","x_correlation_id":"67271ebf-a8d6-4529-4bc4-8740453656f0","timestamp":"2024-10-11T09:47:50.251Z","layer":"cds","component_type":"application","container_id":"10.0.201.37","component_id":"d6e5f463-015b-4627-9961-ad75ffd021a7","component_name":"incident-management-srv","component_instance":0,"source_instance":0,"organization_name":"referenceapps_hadr-validation-bf23fbzw","organization_id":"e383ed10-dd89-42b0-a28f-b9d4103cc194","space_name":"acceptance","space_id":"d014c282-bc64-4280-824b-1e908a8f5845","msg":"500 > { code: '500', message: 'Internal Server Error' }","type":"log"}

DMS Repsitory details

POST https://api-sdm-di.cfapps.eu10.hana.ondemand.com/rest/v2/repositories

Request

{
  "repository": {
    "displayName": "ZINC",
    "description": "repository for incident",
    "repositoryType": "internal",
    "isVersionEnabled": "false",
    "isVirusScanEnabled": "false",
    "skipVirusScanForLargeFile": "false",
    "hashAlgorithms": "SHA-256"    
}
}

Response

{
    "repoAndConnectionInfos": {
        "connection": {
            "type": "ecmdocumentservice"
        },
        "repository": {
            "cmisRepositoryId": "6626267000f54f49503f8076",
            "createdTime": "2024-10-11T09:42:29.292Z",
            "description": "repository for incident",
            "id": "87037cb4-3e99-42b9-93fb-6243923c51b9",
            "lastUpdatedTime": "2024-10-11T09:42:29.292Z",
            "name": "ZINC",
            "repositoryCategory": "Instant",
            "repositoryParams": [
                {
                    "paramName": "hashAlgorithms",
                    "paramValue": "SHA-256"
                },
                {
                    "paramName": "isVirusScanEnabled",
                    "paramValue": false
                },
                {
                    "paramName": "isThumbnailEnabled",
                    "paramValue": false
                },
                {
                    "paramName": "skipVirusScanForLargeFile",
                    "paramValue": false
                },
                {
                    "paramName": "isClientCacheEnabled",
                    "paramValue": false
                },
                {
                    "paramName": "isEncryptionEnabled",
                    "paramValue": false
                },
                {
                    "paramName": "isVersionEnabled",
                    "paramValue": false
                }
            ],
            "repositorySubType": "SAP Document Management Service",
            "repositoryType": "internal"
        }
    }
}

Response for Respositry info

GET https://api-sdm-di.cfapps.eu10.hana.ondemand.com/browser/87037cb4-3e99-42b9-93fb-6243923c51b9?cmisselector=repositoryInfo

Response

{
    "87037cb4-3e99-42b9-93fb-6243923c51b9": {
        "repositoryId": "87037cb4-3e99-42b9-93fb-6243923c51b9",
        "repositoryName": "ZINC",
        "repositoryDescription": "repository for incident",
        "vendorName": "SAP AG",
        "productName": "SAP Document Management Service",
        "productVersion": "1.0",
        "rootFolderId": "6626267000f54f49503f8076",
        "capabilities": {
            "capabilityContentStreamUpdatability": "anytime",
            "capabilityChanges": "objectidsonly",
            "capabilityRenditions": "none",
            "capabilityGetDescendants": true,
            "capabilityGetFolderTree": true,
            "capabilityMultifiling": false,
            "capabilityUnfiling": false,
            "capabilityVersionSpecificFiling": false,
            "capabilityPWCSearchable": false,
            "capabilityPWCUpdatable": true,
            "capabilityAllVersionsSearchable": false,
            "capabilityOrderBy": "custom",
            "capabilityQuery": "metadataonly",
            "capabilityJoin": "none",
            "capabilityACL": "manage",
            "capabilityCreatablePropertyTypes": {
                "canCreate": [
                    "boolean",
                    "id",
                    "integer",
                    "datetime",
                    "decimal",
                    "html",
                    "string",
                    "uri"
                ]
            },
            "capabilityNewTypeSettableAttributes": {
                "id": true,
                "localName": true,
                "localNamespace": true,
                "displayName": true,
                "queryName": false,
                "description": true,
                "creatable": true,
                "fileable": false,
                "queryable": true,
                "fulltextIndexed": true,
                "includedInSupertypeQuery": true,
                "controllablePolicy": false,
                "controllableACL": false
            }
        },
        "aclCapabilities": {
            "supportedPermissions": "both",
            "propagation": "propagate",
            "permissions": [
                {
                    "permission": "cmis:read",
                    "description": "cmis:read"
                },
                {
                    "permission": "sap:file",
                    "description": "sap:file"
                },
                {
                    "permission": "cmis:write",
                    "description": "cmis:write"
                },
                {
                    "permission": "sap:delete",
                    "description": "sap:delete"
                },
                {
                    "permission": "cmis:all",
                    "description": "cmis:all"
                }
            ],
            "permissionMapping": [
                {
                    "key": "canUpdateProperties.Object",
                    "permission": [
                        "cmis:write"
                    ]
                },
                {
                    "key": "canGetProperties.Object",
                    "permission": [
                        "cmis:read"
                    ]
                },
                {
                    "key": "canCreateFolder.Folder",
                    "permission": [
                        "sap:file",
                        "cmis:write"
                    ]
                },
                {
                    "key": "canCreateDocument.Folder",
                    "permission": [
                        "sap:file",
                        "cmis:write"
                    ]
                },
                {
                    "key": "canCheckout.Document",
                    "permission": [
                        "cmis:write"
                    ]
                },
                {
                    "key": "canMove.Object",
                    "permission": [
                        "sap:file",
                        "cmis:write"
                    ]
                },
                {
                    "key": "canGetAllVersions.VersionSeries",
                    "permission": [
                        "cmis:read"
                    ]
                },
                {
                    "key": "canCheckin.Document",
                    "permission": [
                        "sap:delete",
                        "cmis:all"
                    ]
                },
                {
                    "key": "canGetDescendents.Folder",
                    "permission": [
                        "cmis:read"
                    ]
                },
                {
                    "key": "canGetChildren.Folder",
                    "permission": [
                        "cmis:read"
                    ]
                },
                {
                    "key": "canGetParents.Folder",
                    "permission": [
                        "cmis:read"
                    ]
                },
                {
                    "key": "canSetContent.Document",
                    "permission": [
                        "cmis:write"
                    ]
                },
                {
                    "key": "canDeleteContent.Document",
                    "permission": [
                        "cmis:write"
                    ]
                },
                {
                    "key": "canGetACL.Object",
                    "permission": [
                        "cmis:read"
                    ]
                },
                {
                    "key": "canMove.Target",
                    "permission": [
                        "sap:file",
                        "cmis:write"
                    ]
                },
                {
                    "key": "canDelete.Object",
                    "permission": [
                        "sap:delete",
                        "cmis:all"
                    ]
                },
                {
                    "key": "canCancelCheckout.Document",
                    "permission": [
                        "sap:delete",
                        "cmis:all"
                    ]
                },
                {
                    "key": "canApplyACL.Object",
                    "permission": [
                        "cmis:all"
                    ]
                },
                {
                    "key": "canGetFolderParent.Object",
                    "permission": [
                        "cmis:read"
                    ]
                },
                {
                    "key": "canMove.Source",
                    "permission": [
                        "sap:file",
                        "cmis:write"
                    ]
                },
                {
                    "key": "canDeleteTree.Folder",
                    "permission": [
                        "sap:delete",
                        "cmis:all"
                    ]
                }
            ]
        },
        "latestChangeLogToken": "1728640777899",
        "cmisVersionSupported": "1.1",
        "changesIncomplete": false,
        "changesOnType": [
            "cmis:document",
            "cmis:folder"
        ],
        "principalIdAnonymous": "{sap:builtin}anonymous",
        "principalIdAnyone": "{sap:builtin}everyone",
        "extendedFeatures": [
            {
                "id": "http://docs.oasis-open.org/ns/cmis/extension/contentstreamhash",
                "commonName": "Content Stream Hash",
                "versionLabel": "1.0",
                "description": "Adds the property cmis:contentStreamHash, which represents the hash of the document content."
            },
            {
                "id": "ecmRepoInfo",
                "featureData": {
                    "virusScanner": "false",
                    "disableVirusScannerForLargeFile": "false",
                    "isThumbnailEnabled": "false",
                    "changeLog": "Enabled",
                    "changeLogDuration": "24",
                    "hashAlgorithms": "SHA-256",
                    "isEncryptionEnabled": "false"
                }
            },
            {
                "id": "http://docs.oasis-open.org/ns/cmis/extension/datetimeformat",
                "url": "https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=cmis",
                "commonName": "Browser Binding DateTime Format",
                "versionLabel": "1.0",
                "description": "Adds an additional DateTime format for the Browser Binding."
            },
            {
                "id": "http://docs.oasis-open.org/ns/cmis/extension/datetimeformat",
                "url": "https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=cmis",
                "commonName": "Browser Binding DateTime Format",
                "versionLabel": "1.0",
                "description": "Adds an additional DateTime format for the Browser Binding."
            }
        ],
        "repositoryUrl": "https://api-sdm-di.cfapps.eu10.hana.ondemand.com/browser/87037cb4-3e99-42b9-93fb-6243923c51b9",
        "rootFolderUrl": "https://api-sdm-di.cfapps.eu10.hana.ondemand.com/browser/87037cb4-3e99-42b9-93fb-6243923c51b9/root",
        "cmisRepositoryId": "6626267000f54f49503f8076",
        "repositoryCategory": "Instant",
        "externalId": null,
        "connectionType": "service"
    }
}
rashmiangadi11 commented 1 week ago

Hi ejazsyed, Do you deploy your application to BTP or running it locally? Can you share the BTP srv application logs if you are running on BTP.

Regards, Rashmi

ejazsyed commented 1 week ago

This got fixed , after recreating dms instance.