Comments (9)
Just been replicating this issue for someone over on Slack, and can confirm this is a v3.114.0 regression.
I suspect this PR is related: #15607
It seems the engine runs in the cwd of where pulumi is executed from, disregarding the value specified in pulumi.yaml//main
.
Minimal replication for pulumi preview
(using aws bucket as I couldn't find a local provider that utilises pulumi assets):
# Pulumi.yaml
name: pulumi-chdir
runtime:
name: python
options:
virtualenv: venv
main: stack/
description: A minimal Python Pulumi program
# stack/__main__.py
import pulumi
import pulumi_aws
import os
stub_path = "../stub"
print(os.getcwd()) ## reports in directory of this file for both v3.113.3 and v3.114.0
asset = pulumi.FileArchive(stub_path)
# create a bucket, and upload the asset
bucket = pulumi_aws.s3.Bucket("my-bucket")
bucket_object = pulumi_aws.s3.BucketObject(
"my-bucket-object",
bucket=bucket.id,
source=asset, # engine reading this seems to be from the cwd of the command, instead of the project path specified in the Pulumi.yaml
# make it private
acl="private",
)
# stub/stub.py
# just a stub file
from pulumi.
Yup can confirm, we fixed file archive to handle files but the path lookup is wrong for folders. I'll add that to the tests and get it fixed, should be able to get a release out early next week with this fixed.
from pulumi.
Yup can confirm this is asset/archive hash calculations. I think it's a pretty easy fix of threading the current directory down to the right places.
This is the right fix, we can't just revert this because we want sub-programs to work one day (soon) and they necesiarlly work from a different working directory.
from pulumi.
Still facing the same problem with 3.115.0
pulumi about:
CLI
Version 3.115.0
Go Version go1.22.2
Go Compiler gc
Plugins
KIND NAME VERSION
resource aws 6.33.1
language python unknown
Host
OS arch
Version "23.1.4"
Arch x86_64
This project is written in python: executable='/home/anthony/.pyenv/shims/python3' version='3.12.3'
Current Stack: antdking/pulumi-chdir/dev
Found no resources associated with dev
Found no pending operations associated with dev
Backend
Name pulumi.com
URL https://app.pulumi.com/antdking
User antdking
Organizations antdking, antdking-testing
Token type personal
Dependencies:
NAME VERSION
pip 24.0
pulumi_aws 6.33.1
setuptools 69.5.1
wheel 0.43.0
pip show, as the pulumi sdk version doesn't seem to get detected:
$ venv/bin/pip show pulumi
Name: pulumi
Version: 3.115.0
Summary: Pulumi's Python SDK
Home-page: https://github.com/pulumi/pulumi
Author:
Author-email:
License: Apache 2.0
Location: /home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages
Requires: dill, grpcio, protobuf, pyyaml, semver, six
Required-by: pulumi_aws
Presumably this will be fixed once providers are updated to build against 3.115.0?
from pulumi.
Still facing the same problem with 3.115.0
Can you post the error message you're getting?
from pulumi.
Can you post the error message you're getting?
Previewing update (dev)
View in Browser (Ctrl+O): https://app.pulumi.com/antdking/pulumi-chdir/dev/previews/693c06ac-5d79-4524-b43c-79eb44de87ea
Type Name Plan Info
+ pulumi:pulumi:Stack pulumi-chdir-dev create 1 error
+ └─ aws:s3:Bucket my-bucket create
Diagnostics:
pulumi:pulumi:Stack (pulumi-chdir-dev):
error: Program failed with an unhandled exception:
Traceback (most recent call last):
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/pulumi/runtime/resource.py", line 1009, in do_rpc_call
return monitor.RegisterResource(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/grpc/_channel.py", line 1160, in __call__
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/grpc/_channel.py", line 1003, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "failed to compute archive hash for "source": couldn't read archive path '../stub': stat ../stub: no such file or directory"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-05-03T15:38:24.914057726+01:00", grpc_status:2, grpc_message:"failed to compute archive hash for \"source\": couldn\'t read archive path \'../stub\': stat ../stub: no such file or directory"}"
>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/anthony/.pulumi/bin/pulumi-language-python-exec", line 191, in <module>
loop.run_until_complete(coro)
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 138, in run_in_stack
await run_pulumi_func(run)
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 52, in run_pulumi_func
await wait_for_rpcs()
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 114, in wait_for_rpcs
await task
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/pulumi/runtime/resource.py", line 1014, in do_register
resp = await asyncio.get_event_loop().run_in_executor(None, do_rpc_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/pulumi/runtime/resource.py", line 1011, in do_rpc_call
handle_grpc_error(exn)
File "/home/anthony/experiments/pulumi-chdir/venv/lib/python3.12/site-packages/pulumi/runtime/settings.py", line 307, in handle_grpc_error
raise grpc_error_to_exception(exn)
Exception: failed to compute archive hash for "source": couldn't read archive path '../stub': stat ../stub: no such file or directory
from pulumi.
I just tested with FileAsset, and this is fixed in 3.115.0 (broken in 3.114).
So it's just FileArchive that still has the working directory missing.
from pulumi.
Thanks I'll check that.
from pulumi.
Related Issues (20)
- when use vault kubernetes, inputs.tokenReviewerJwt field in stack checkpoint json is not encrypted HOT 2
- Python memory pressure from tracking all outputs till the end of the program
- Structured configuration errors in Pulumi.yaml (which work in Pulumi.stack.yaml) HOT 2
- Add the ability to override `PluginDownloadURL` if it is explicitly set on a plugin
- Add an `ArtifactorySource` as a `PluginSource` to plugins.go
- Do not warn on changing outputs during refresh HOT 1
- Cannot convert undefined or null to object at `@pulumi/runtime/closure/codePaths.ts:250:34` HOT 2
- Allow conformance test sdk generation to run in parallel
- Workflow failure: On Push HOT 4
- Invalid lists of enums in .NET
- CLI concurrent map read and map write panic
- `TestLanguageNewSmoke/java` broken on the main branch HOT 1
- Nu se deschide o fereastră
- Python automation.Stack.up() orphans _watch_logs thread HOT 2
- Accurate property and resource references in descriptions HOT 1
- Make it possible to only upgrade providers without updating state HOT 1
- Pulumi loads multiple default providers for same package
- Python Conformance tests are flaky HOT 1
- Improve target framework support HOT 3
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 pulumi.