Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in SFTP: Accessing a hash algorithm by manipulating the HashName property is not supported #851

Closed
maakku opened this issue Aug 10, 2023 · 5 comments
Labels

Comments

@maakku
Copy link

maakku commented Aug 10, 2023

Describe the Bug

I am trying to upload file content to an SFTP server with the built-in SFTP connector. I get the following error for every file I try to upload:

The service provider action failed with error code 'BadRequest' and error message 'Accessing a hash algorithm by manipulating the HashName property is not supported on this platform. Instead, you must instantiate one of the supplied subtypes (such as HMACSHA1.)'.

The workflow is very basic: it reads files from a SFTP server, loops through the found files, uploads them to another SFTP server inside a for-each loop and deletes the original files.

Plan Type

Standard

Steps to Reproduce the Bug or Issue

  1. Try to upload a file to a SFTP server with the built-in connector, uploadFileContent action.

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "If_files_found": {
                "actions": {
                    "ForEachFile": {
                        "actions": {
                            "DeleteSFTP1File": {
                                "inputs": {
                                    "parameters": {
                                        "filePath": "@items('ForEachFile')?['pathRelativeToRootDirectory']",
                                        "skipDelete": false
                                    },
                                    "serviceProviderConfiguration": {
                                        "connectionName": "Sftp_1",
                                        "operationId": "deleteFile",
                                        "serviceProviderId": "/serviceProviders/Sftp"
                                    }
                                },
                                "runAfter": {
                                    "UploadFileContentToSFTP2": [
                                        "Succeeded"
                                    ]
                                },
                                "type": "ServiceProvider"
                            },
                            "GetSFTP1FileContent": {
                                "inputs": {
                                    "parameters": {
                                        "filePath": "@items('ForEachFile')?['pathRelativeToRootDirectory']"
                                    },
                                    "serviceProviderConfiguration": {
                                        "connectionName": "Sftp_1",
                                        "operationId": "getFileContentV2",
                                        "serviceProviderId": "/serviceProviders/Sftp"
                                    }
                                },
                                "type": "ServiceProvider"
                            },
                            "UploadFileContentToSFTP2": {
                                "inputs": {
                                    "parameters": {
                                        "content": "@body('GetSFTP1FileContent')",
                                        "filePath": "@{parameters('SFTP2TargetPath')}/@{encodeUriComponent(items('ForEachFile')['name'])}",
                                        "overWriteFileIfExists": true
                                    },
                                    "serviceProviderConfiguration": {
                                        "connectionName": "Sftp_2",
                                        "operationId": "uploadFileContent",
                                        "serviceProviderId": "/serviceProviders/Sftp"
                                    }
                                },
                                "runAfter": {
                                    "GetSFTP1FileContent": [
                                        "Succeeded"
                                    ]
                                },
                                "type": "ServiceProvider"
                            }
                        },
                        "foreach": "@body('ListSFTP1Files')",
                        "type": "Foreach"
                    }
                },
                "else": {
                    "actions": {
                        "TerminateCancelled": {
                            "inputs": {
                                "runStatus": "Cancelled"
                            },
                            "type": "Terminate"
                        }
                    }
                },
                "expression": {
                    "and": [
                        {
                            "not": {
                                "equals": [
                                    "@empty(body('ListSFTP1Files'))",
                                    "@true"
                                ]
                            }
                        }
                    ]
                },
                "runAfter": {
                    "ListSFTP1Files": [
                        "SUCCEEDED"
                    ]
                },
                "type": "If"
            },
            "ListSFTP1Files": {
                "inputs": {
                    "parameters": {
                        "filesOnly": true,
                        "folderPath": "@parameters('SFTP1SourcePath')"
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "Sftp_1",
                        "operationId": "listFolder",
                        "serviceProviderId": "/serviceProviders/Sftp"
                    }
                },
                "runAfter": {},
                "type": "ServiceProvider"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "Recurrence": {
                "recurrence": {
                    "frequency": "Minute",
                    "interval": 15
                },
                "type": "Recurrence"
            }
        }
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Additional context

No response

AB#24810127

@maakku
Copy link
Author

maakku commented Aug 10, 2023

Not sure if this was some temporary glitch, because after running the workflow again in a couple of hours there were no more errors.

@maakku maakku closed this as completed Aug 11, 2023
@maakku maakku reopened this Aug 16, 2023
@maakku
Copy link
Author

maakku commented Aug 16, 2023

This error seems to occur occasionally, could this be an SFTP server issue?

@maakku
Copy link
Author

maakku commented Aug 24, 2023

Is the SFTP connector using the SSH.NET library under the hood by any chance?

Could this issue be related to this: sshnet/SSH.NET#859

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

This issue is stale because it has been open for 45 days with no activity.

@github-actions github-actions bot added the stale label Oct 8, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant