Giter Club home page Giter Club logo

Comments (4)

gabriel-samfira avatar gabriel-samfira commented on August 16, 2024

Hi @bittrance

I tried to run this locally in VSCode. Followed the guide here: https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-powershell

I got a huge nr of errors, some like the one you pointed out. But the first one was:

[2023-06-02T16:30:47.854Z] Worker process started and initialized.
[2023-06-02T16:30:51.789Z] Host lock lease acquired by instance ID '000000000000000000000000297420BE'.
[2023-06-02T16:30:58.110Z] Executing 'Functions.HttpTrigger1' (Reason='This function was programmatically called via the host APIs.', Id=020aa55f-7303-4807-aa68-b110816ca439)
[2023-06-02T16:30:58.822Z] ERROR: Exception calling "GetFiles" with "3" argument(s): "Could not find a part of the path '/usr/lib/azure-functions-core-tools-4/workers/powershell/7.2/runtimes/unix/lib/net6.0/ref'."
[2023-06-02T16:30:58.822Z] 
[2023-06-02T16:30:58.822Z] Exception             : 
[2023-06-02T16:30:58.822Z]     Type           : System.Management.Automation.MethodInvocationException
[2023-06-02T16:30:58.822Z]     ErrorRecord    : 
[2023-06-02T16:30:58.822Z]         Exception             : 
[2023-06-02T16:30:58.822Z]             Type    : System.Management.Automation.ParentContainsErrorRecordException
[2023-06-02T16:30:58.822Z]             Message : Exception calling "GetFiles" with "3" argument(s): "Could not find a part of the path '/usr/lib/azure-functions-core-tools-4/workers/powershell/7.2/runtimes/unix/lib/net6.0/ref'."
[2023-06-02T16:30:58.822Z]             HResult : -2146233087
[2023-06-02T16:30:58.822Z]         CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
[2023-06-02T16:30:58.822Z]         FullyQualifiedErrorId : DirectoryNotFoundException
[2023-06-02T16:30:58.823Z]         InvocationInfo        : 
[2023-06-02T16:30:58.823Z]             ScriptLineNumber : 375
[2023-06-02T16:30:58.823Z]             OffsetInLine     : 9
[2023-06-02T16:30:58.823Z]             HistoryId        : -1
[2023-06-02T16:30:58.823Z]             ScriptName       : /home/gabriel/.local/share/powershell/Modules/powershell-yaml/0.4.7/powershell-yaml.psm1
[2023-06-02T16:30:58.823Z]             Line             : $referenceList += [IO.Directory]::GetFiles([IO.Path]::Combine($PSHOME, 'ref'), 'netstandard.dll', [IO.SearchOption]::TopDirectoryOnly)
[2023-06-02T16:30:58.823Z]                                
[2023-06-02T16:30:58.823Z]             PositionMessage  : At /home/gabriel/.local/share/powershell/Modules/powershell-yaml/0.4.7/powershell-yaml.psm1:375 char:9
[2023-06-02T16:30:58.823Z]                                +         $referenceList += [IO.Directory]::GetFiles([IO.Path]::Combine …
[2023-06-02T16:30:58.823Z]                                +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2023-06-02T16:30:58.823Z]             PSScriptRoot     : /home/gabriel/.local/share/powershell/Modules/powershell-yaml/0.4.7
[2023-06-02T16:30:58.823Z]             PSCommandPath    : /home/gabriel/.local/share/powershell/Modules/powershell-yaml/0.4.7/powershell-yaml.psm1
[2023-06-02T16:30:58.823Z]             CommandOrigin    : Internal
[2023-06-02T16:30:58.823Z]         ScriptStackTrace      : at <ScriptBlock>, /home/gabriel/.local/share/powershell/Modules/powershell-yaml/0.4.7/powershell-yaml.psm1: line 375
[2023-06-02T16:30:58.823Z]                                 at <ScriptBlock>, /home/gabriel/work/cloudbase/azureFunction/profile.ps1: line 11

The interesting bit was:

[2023-06-02T16:30:58.822Z] ERROR: Exception calling "GetFiles" with "3" argument(s): "Could not find a part of the path '/usr/lib/azure-functions-core-tools-4/workers/powershell/7.2/runtimes/unix/lib/net6.0/ref'."

When I looked for that file:

gabriel@arrakis:~$ ls /usr/lib/azure-functions-core-tools-4/workers/powershell/7.2/runtimes/unix/lib/net6.0/ref
ls: cannot access '/usr/lib/azure-functions-core-tools-4/workers/powershell/7.2/runtimes/unix/lib/net6.0/ref': No such file or directory

I am not sure how to set that path properly (never used azure functions), but I cheated a bit (for the sake of time) by running:

sudo ln -s /usr/lib/azure-functions-core-tools-4/workers/powershell/7.2/ref /usr/lib/azure-functions-core-tools-4/workers/powershell/7.2/runtimes/unix/lib/net6.0/ref

(There is most probably a right way to do this)

After which I could run the function with powershell-yaml and it works.

Stumbled across this: PowerShell/PowerShell#9587

from powershell-yaml.

gabriel-samfira avatar gabriel-samfira commented on August 16, 2024

This seems to be a runtime issue. There seem to be missing refs.

from powershell-yaml.

bittrance avatar bittrance commented on August 16, 2024

Thanks for the rapid response ❤️ I can confirm that the ln hack works when doing func host start. I reported this issue on the worker.

I'll leave it up to you to decide whether you want to keep this issue open for visibility or not.

from powershell-yaml.

gabriel-samfira avatar gabriel-samfira commented on August 16, 2024

Happy to help!

The issue will be indexed even if we close it. Most people will probably get here via Google anyway 😄 .

from powershell-yaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.