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

Error: Cannot process argument transformation on parameter 'Exception'. #379

Closed
5 tasks
RPSQL opened this issue Mar 9, 2018 · 11 comments · Fixed by #380
Closed
5 tasks

Error: Cannot process argument transformation on parameter 'Exception'. #379

RPSQL opened this issue Mar 9, 2018 · 11 comments · Fixed by #380

Comments

@RPSQL
Copy link

RPSQL commented Mar 9, 2018

Issue

This is a bug or unexpected behaviour/feature request/new check/question (delete as applicable)
unexpected behavior *******

Bug Report

General Troubleshooting steps

  • Verified running the latest release of dbachecks?
    Yes *****
    Does (Find-Module dbachecks).Version match (Get-Module dbachecks).Version.ToString()

image

  • Verified errors are not related to permissions?
    Yes verified errors are not related to permissions
  • Can duplicate in new/clean PowerShell session (clean = powershell -NoProfile)?

Version Information

  • Operating System (Name|Version): Windows Server 2012 Data Center
  • PowerShell Version: 5.0.10586.117
  • SQL Server (Edition|Version): SQL Server 2014 Developer Edition

Steps to Reproduce

<--
PLEASE include as much information as possible if this is a bug report.


Invoke-DbcCheck -SqlInstance Server Name -Checks Connectivity, Database, DiskCapacity, FailedJob, HADR, Instance, InstanceConnection, LastBackup, LastDiffBackup, LastFullBackup,
LastGoodCheckDb, LastLogBackup, MemoryDump, NetworkLatency, Server, ServerNameMatch, ServiceAccount, SuspectPage, SystemIntegrityCheck -ExcludeCheck AdHocWorkload, Agent, AgentServiceAccount, AutoClose, AutoCreateStatistics, AutoShrink, AutoUpdateStatistics, AutoUpdateStatisticsAsynchronously, AvailabilityGroupHealth,
BackupPathAccess, ClusterHealth, ClusterNetworkHealth, ClusterServerHealth, CommandLog, Connectivity, DAC, DatabaseCollation, DatabaseGrowthEvent, DatabaseMailProfile,
DatafileAutoGrowthType, DbaOperator, DefaultBackupCompression, DeleteBackupHistory, DISA, DisabledIndex, Domain, DomainName, DuplicateIndex, ExtendedEvent,
FailsafeOperator, FileGroupBalanced, IdentityUsage, Instance, InstanceConnection, InvalidDatabaseOwner, LinkedServerConnection, LogfileCount, LogfileSize, LogShipping,
LogShippingPrimary, LogShippingSecondary, MaintenancePlan, MaxMemory, OLEAutomation, Operator, OrganizationalUnit, OrphanedFile, OrphanedUser, OutputFileCleanup,
PageVerify, PingComputer, PowerPlan, PseudoSimple, PurgeJobHistory, RecoveryModel, SaRenamed, SPN, SqlBrowserServiceAccount, SqlEngineServiceAccount, Storage,
SupportedBuild, SystemFull, TempDbConfiguration, TestLastBackup, TestLastBackupVerifyOnly, Trustworthy, UnusedIndex, UserDiff, UserFull, UserIndexOptimize, UserIntegrityCheck,
UserLog, ValidDatabaseOwner, ValidJobOwner, VirtualLogFile, WhoIsActiveInstalled, XESessionRunning, XESessionRunningAllowed, XESessionStopped -Show Summary -PassThru | Update-DbcPowerBiDataSource

Launch Power BI then hit refresh

Start-DbcPowerBi


capture
Getting Error when I included more -Checks and -Exclude types.
Errors Message- top-PSFFunction : Cannot process argument transformation on parameter 'Exception'. Cannot convert the "The specified path, file name, or both are too long. The fully qualified
file name must be less than 260 characters, and the directory name must be less than 248 characters." value of type "http://System.Management .Automation.ErrorRecord" to type
"System.Exception".
At line:97 char:64

  •             Stop-PSFFunction -Message "Failure" -Exception $_
    
  •                                                            ~~
    
    • CategoryInfo : InvalidData: (:) [Stop-PSFFunction], ParameterBindingArgumentTransformationException
    • FullyQualifiedErrorId : ParameterArgumentTransformationError,Stop-PSFFunction

-->

  • Attach any screenshots (if possible/allowed)
  • Attach output from PowerShell console (if possible/allowed)

Feature Request

<-- Simply answer the question - What would you like dbachecks to do that it doesn't? -->

New Check

What would you like to check?

What should be configurable for the results of the check ?

<-- A value, a set of properties (like FULL, SIMPLE, BULKLOGGED) -->
<-- Should there be any default values for the configs? -->

What should be able to be excluded from being tested ?

<-- Could be databases, Could be Availability Groups etc -->
<-- This would not be instances -->

Additional information

@RPSQL RPSQL changed the title Stop-PSFFunction : Cannot process argument transformation on parameter 'Exception'. Cannot convert the "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters." value of type Error: Cannot process argument transformation on parameter 'Exception'. Mar 9, 2018
@SQLDBAWithABeard
Copy link
Collaborator

@FriedrichWeinmann Should this be raised as a PSFramework issue?

@FriedrichWeinmann
Copy link
Member

FriedrichWeinmann commented Mar 10, 2018

No, as this is a user error, that would not be necessary.
When passing the full error record (recommended in most instances), you should not use the -Exception parameter, but the -ErrorRecord parameter.
In the error message you can see, that you pass the full error record to the -Exception parameter (which really only exists in order to be able to unwrap a nested inner exception)

Just to clarify @RPSQL : No error of yours :)

@SQLDBAWithABeard
Copy link
Collaborator

ok - so we need to find that call in invoke-dbcchecks (sat in sql saturday right now!)

@michalporeba
Copy link
Collaborator

pull request #380 should resolve this issue. @RPSQL can you test it?

@RPSQL
Copy link
Author

RPSQL commented Mar 13, 2018

I am still getting the same error message even after making the changes.

@RPSQL
Copy link
Author

RPSQL commented Mar 13, 2018

Error Message - ction : Cannot process argument transformation on parameter 'Exception'. Cannot convert the "The specified
path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the
directory name must be less than 248 characters." value of type "System.Management.Automation.ErrorRecord" to type
"System.Exception".
At line:97 char:64

  •             Stop-PSFFunction -Message "Failure" -Exception $_
    
  •                                                            ~~
    
    • CategoryInfo : InvalidData: (:) [Stop-PSFFunction], ParameterBindingArgumentTransformationException
    • FullyQualifiedErrorId : ParameterArgumentTransformationError,Stop-PSFFunction

@RPSQL
Copy link
Author

RPSQL commented Mar 13, 2018

Thanks for update.

@potatoqualitee
Copy link
Member

My apologies, I hadn't committed the code to master yet. But it should be there momentarily. Nevertheless, the issue is on our side. We didn't shorten the filename enough, somehow. @ClaudioESSilva, remember when we had this issue and addressed it to shorten up to 225 chars? Can you take a look?

@potatoqualitee
Copy link
Member

While we address the error, @RPSQL - you can likely shorten your output filename by using Groups instead of individual checks. For instance, the two XE tests can be executed as one using either Instance (which is rather broad) or ExtendedEvent

image

Or alternatively, specify -AllChecks with ExcludedChecks instead of included ones.

@RPSQL
Copy link
Author

RPSQL commented Mar 13, 2018

Thanks for the update. I will shorten my output now.

@SQLDBAWithABeard
Copy link
Collaborator

closed

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

Successfully merging a pull request may close this issue.

5 participants