Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

The handle is invalid

Open
#185 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
azure, github-actions, sql, typescript
Domain
ci-cd, databases

Research direction

Start with the azure/sql-action@v2.2 workflow entry point and the migration-38.sql path shown in the run log; reproduce the Windows run and inspect the displayed sqlcmd invocation. Done means the migration script runs without repeated “The handle is invalid” errors or hanging.

Written by the indexing model from the issue text.

Description

idle waiting-for-user

When attempting to run a script migration, I'm getting this endlessly until it either times out or I cancel.

2023-08-04 14 45 55

Run azure/sql-action@v2.2
  with:
    connection-string: ***
    path: ./migration-38.sql
  env:
    BUILD_CONFIGURATION: Release
    AZURE_HTTP_USER_AGENT: 
    AZUREPS_HOST_ENVIRONMENT: 
  
##[debug]isExplicit: 1.0.0
##[debug]explicit? true
##[debug]checking cache: C:\hostedtoolcache\windows\go-sqlcmd\1.0.0\x64
##[debug]not found
##[debug]Downloading https://github.com/microsoft/go-sqlcmd/releases/download/v1.0.0/sqlcmd-v1.0.0-windows-x64.zip
##[debug]Destination D:\a\_temp\81a[35](https://github.com/[redacted]/actions/runs/5765555095/job/15631847638#step:5:35)bc3-5e90-4525-b0ed-3e91a0bac914.zip
##[debug]download complete
##[debug]Using pwsh at path: C:\Program Files\PowerShell\7\pwsh.exe
"C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ; try { [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a\_temp\81a35bc3-5e90-4525-b0ed-3e91a0bac914.zip', 'D:\a\_temp\6506c02c-80c5-4b8e-a902-ac3f8e41[36](https://github.com/[redacted]/actions/runs/5765555095/job/15631847638#step:5:36)ff', $true) } catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath 'D:\a\_temp\81a35bc3-5e90-4525-b0ed-3e91a0bac914.zip' -DestinationPath 'D:\a\_temp\6506c02c-80c5-4b8e-a902-ac3f8e4136ff' -Force } else { throw $_ } } ;"
##[debug]Caching tool go-sqlcmd 1.0.0 x64
##[debug]source dir: D:\a\_temp\6506c02c-80c5-4b8e-a902-ac3f8e4136ff
##[debug]destination C:\hostedtoolcache\windows\go-sqlcmd\1.0.0\x64
##[debug]finished caching tool
##[debug]Get action inputs.
::add-mask::***
::add-mask::***
##[debug]Validating if client has access to 'master' on '[redacted].database.windows.net'.
##[debug]Begin executing sql script
sqlcmd.exe -S [redacted].database.windows.net -d [redacted] -U *** -i ./migration-[38](https://github.com/[redacted]/actions/runs/5765555095/job/15631847638#step:5:39).sql
read ./migration-38.sql: The handle is invalid.
read ./migration-38.sql: The handle is invalid.
read ./migration-38.sql: The handle is invalid.
read ./migration-38.sql: The handle is invalid.
read ./migration-38.sql: The handle is invalid.

Here's the migration step yaml:

      - name: Run DB Migration Script
        uses: azure/sql-action@v2.2
        with:        
          connection-string: ${{ secrets.AZURE_SQL_CONNECTION_STRING }}
          path: './migration-${{ github.run_number }}.sql'

Any ideas?

Dominant language
TypeScript
Stars
142
Forks
73
Avg merge
9d 18h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/sql-action

All issues in Azure/sql-action

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.