Comments (4)
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.
This seems to be a runtime issue. There seem to be missing refs.
from powershell-yaml.
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.
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)
- Add `Test-Yaml` cmdlet
- Class with PSCustomObject ConvertTo-Yaml fail HOT 1
- Copyright is out of date HOT 2
- This Module conflicts with Az.Aks HOT 3
- an object with property name "keys" HOT 3
- `SerializationOptions` should be defined with `[Flags()]`
- Add `-Ordered` parameter info to documentation HOT 1
- Import-Module error HOT 4
- Yaml output is not respected when exporting Powershell nested classes.
- Could not find file '/usr/lib/powershell/ref/System.Private.CoreLib.dll' version 0.4.7 HOT 1
- Convetto-Yaml: Value starting with double quote is being enclosed by single quotes. HOT 5
- mscorlib is not referenced HOT 2
- Cannot find type [YamlDotNet.Core.Parser]
- powershell-yaml module is down HOT 1
- Converting From Yaml but the Input is a variable with a file content HOT 3
- Disable string to date auto conversion HOT 18
- ConvertTo-Yaml multi-line scalar output HOT 2
- Supporting a different schema HOT 3
- Support to PowerShell in Constrained Language Mode HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powershell-yaml.