https://pulumi.com logo
#general
Title
# general
g

gentle-market-22852

08/22/2022, 2:57 AM
Trying to build docker images based on this info https://www.pulumi.com/learn/pulumi-fundamentals/create-docker-images/ however it gives this error.. any clues on what this errors are https://app.pulumi.com/nagkumar/docker/dev/previews/f77afebf-b3ae-4d54-b0a4-e6e3f769a5ac
f

freezing-van-87649

08/22/2022, 2:58 AM
404, pretty sure none of us can see that error
g

gentle-market-22852

08/22/2022, 2:59 AM
G:\DWork\osource\cloudc\devops\pulumi\java\docker>pulumi up Previewing update (dev) View Live: https://app.pulumi.com/nagkumar/docker/dev/previews/f77afebf-b3ae-4d54-b0a4-e6e3f769a5ac Type Name Plan Info + pulumipulumiStack docker-dev create 22 messages └─ dockerindexRemoteImage backend 1 error Diagnostics: dockerindexRemoteImage (backend): error: could not validate provider configuration: 7 errors occurred: * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key pulumipulumiStack (docker-dev): Exception in thread "main" java.lang.IllegalArgumentException: Program run without the Pulumi engine available; re-run using the
pulumi
CLI at com.pulumi.deployment.internal.DeploymentImpl$DeploymentState.lambda$fromEnvironment$2(DeploymentImpl.java:1660) at com.pulumi.core.Left.orThrow(Left.java:57) at com.pulumi.deployment.internal.DeploymentImpl$DeploymentState.fromEnvironment(DeploymentImpl.java:1665) at com.pulumi.deployment.internal.DeploymentImpl.fromEnvironment(DeploymentImpl.java:155) at com.pulumi.internal.PulumiInternal.fromEnvironment(PulumiInternal.java:41) at com.pulumi.Pulumi.withOptions(Pulumi.java:51) at com.pulumi.Pulumi.run(Pulumi.java:29) at com.tejasoft.devops.iac.pulumi.docker.DockerPulumiApp.main(DockerPulumiApp.java:12) Caused by: java.lang.IllegalArgumentException: expected environment variable: 'PULUMI_MONITOR', got: [DCA_BU_ROOT, PRJ_BAT_DIR, VIRTUSA_BAT_DIR, GRAILS_HOME, QS_BAT_DIR, SESSIONNAME, ALLUSERSPROFILE, DevEco Studio, ANDROID_HOME, CXF_HOME, SystemDrive, BB_BAT_DIR, JRE_HOME, =ExitCode, DEV_ROOT, HASKELL_SDK, RIA_SERVER_HOME, AXIS2_HOME, DIRNAME, NODE_TLS_REJECT_UNAUTHORIZED, USERNAME, RIA_HOME, LANGS_ROOT, NODE_JS_ROOT, ProgramFiles(x86), FPS_BROWSER_USER_PROFILE_STRING, DEFAULT_JVM_OPTS, PATHEXT, DB_HOME, DriverData, IntelliJ IDEA Community Edition, DCA_CODE_BK_ROOT, PYTHON_HOME, R_TOOLS, HOMEPATH, SOPC_KIT_NIOS2, PROCESSOR_IDENTIFIER, AWS_CLI, ProgramFiles, PUBLIC, PH3, windir, QUICK_APP, =::, NPM_TOKEN, BU_SCRIPTS_PREFEX, OneDriveCommercial, NDS_BAT_DIR, ORIGINAL_PATH, FPS_BROWSER_APP_PROFILE_STRING, JAVA_ROOT, JAVA_HOME, PROMPT, VARS_FILE, WebStorm, CAROOT, GRADLE_HOME, ANT_HOME, GROOVY_HOME, MSYSTEM, OneDrive, APPDATA, JAVA_EXE, ChocolateyInstall, Path, NODE_ROOT, RUBY_HOME, CBE_JARS_ROOT, COMPUTERNAME, SYSTEM_APPS_ROOT, ANDROID_INSTALL_ROOT, ComSpec, FND_WEB_DIR, APP_BASE_NAME, ASTUDIO_ROOT, HOMEDRIVE, RDBMS_HOME, QSYS_ROOTDIR, NUMBER_OF_PROCESSORS, USERDOMAIN_ROAMINGPROFILE, NPM_ROOT, JetBrains Rider, PROCESSOR_LEVEL, BAZEL_HOME, PULUMI_HOME, WORK_ROOT, PROCESSOR_ARCHITECTURE, STATIC_SCRIPTING_HOME, PSModulePath, MVN_HOME, ANT_OPTS, COMP_ROOT, SCRIPTS_PREFIX, JDK_HOME, SCRIPTING_HOME, VISUALSVN_SERVER, MG_HOME, APP_HOME, ASTUDIO_PLUGIN_KOTLIN_ROOT, GWT_SDK, BASH_ENV, ANDROID_NDK_ROOT, GOPATH, NPM_PEF_OPS, ProgramData, =F:, ProgramW6432, ASTUDIO_PLUGIN_ROOT, GWT_HOME, GRAILS_OPTS, SE_LICENSE_SERVER, LOCALAPPDATA, ChocolateyLastPathUpdate, USERDOMAIN, LOGONSERVER, PTH2, DCA_CODE_UI_ROOT, =G:, BLD_ENG_HOME, sdk.dir, DCA_SCRIPTS_ROOT, GO_HOME, IDEA_JDK, ZIP_ROOT, FND_BAT_DIR, DCA_CODE_ROOT, SCALA_HOME, CommonProgramFiles, OS, FND_ROOT, R_HOME, ANDROID_SDK_ROOT, PROCESSOR_REVISION, CLASSPATH, CommonProgramW6432, DYNAMIC_SCRIPTING_HOME, N12, N14, N16, FND_BU_CMN, SystemRoot, TEMP, N18, NOSQL_HOME, N17, USERPROFILE, TMP, WSLENV, PRD_ROOT, CommonProgramFiles(x86), DCA_PATH, QUARTUS_ROOTDIR] at com.pulumi.core.internal.Environment.getEnvironmentVariable(Environment.java:42) ... 6 more FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'apprun'. > Process 'command 'D:\Apps\Dev\langs\java\jdk\17.x\bin\java.exe'' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s
f

freezing-van-87649

08/22/2022, 3:01 AM
you sure that’s a docker issue?
`Program run without the Pulumi engine available; re-run using the
pulumi
CLI`
g

gentle-market-22852

08/22/2022, 3:02 AM
Docker for windows is installed.. when do docker build . the image is built properly
Caused by: java.lang.IllegalArgumentException: expected environment variable: 'PULUMI_MONITOR',
f

freezing-van-87649

08/22/2022, 3:04 AM
right, it’s saying it can’t find pulumi, not docker
is that the only resource in the stack? What happens if you delete the docker image resource?
g

gentle-market-22852

08/22/2022, 3:05 AM
it has backend, frontend..etc.. at backend itself it is failing
that’s where the error’s coming from
g

gentle-market-22852

08/22/2022, 3:09 AM
nice.. but how are these env variables set .. var monitorTarget = getEnvironmentVariable("PULUMI_MONITOR").orThrow(startErrorSupplier); var engineTarget = getEnvironmentVariable("PULUMI_ENGINE").orThrow(startErrorSupplier); var project = getEnvironmentVariable("PULUMI_PROJECT").orThrow(startErrorSupplier); var stack = getEnvironmentVariable("PULUMI_STACK").orThrow(startErrorSupplier); var dryRun = getBooleanEnvironmentVariable("PULUMI_DRY_RUN").orThrow(startErrorSupplier);
f

freezing-van-87649

08/22/2022, 3:10 AM
So when you run
pulumi up
, it executes your pulumi code (java in your case). I’m guessing the pulumi cli is misbehaving or configured in a way that somehow prevents it from passing the required env var
g

gentle-market-22852

08/22/2022, 3:11 AM
yes I am using pulumi up and pulumi is in PATH variable
does gradle process innovocation has issue..
f

freezing-van-87649

08/22/2022, 3:14 AM
I could see that being an issue
see what happens if you delete that docker resource from your pulumi app… I bet you end up with the same error
g

gentle-market-22852

08/22/2022, 3:16 AM
?delete that docker resource from your pulumi app what is the command for this
I have added pulumi path at os level, now the error is pulumipulumiStack (docker-dev): error: an unhandled error occurred: 'G:\DWork\osource\cloudc\devops\pulumi\java\docker\gradlew.bat G:\DWork\osource\cloudc\devops\pulumi\java\docker\gradlew.bat run --console=plain' exited with non-zero exit code: 1 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'appcompileJava'. > Could not resolve all files for configuration 'appcompileClasspath'. > Could not resolve com.pulumipulumi0.5.4. Required by: project :app > No matching variant of com.pulumipulumi0.5.4 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but: - Variant 'apiElements' capability com.pulumipulumi0.5.4 declares an API of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs) - Variant 'javadocElements' capability com.pulumipulumi0.5.4 declares a runtime of a component, and its dependencies declared externally:
does it support jdk 8
f

freezing-van-87649

08/22/2022, 3:21 AM
g

gentle-market-22852

08/22/2022, 3:26 AM
When I change jdk from 8 to 11 or 18 same pulumi_monitor error repeats
would be nice if pulumi invokes gradle with all the current pulumi command line env as is
rather than depending on global os variables
any case let me restart the machine and see any changes
strange behavior .. with JDK 8 it says Microsoft Windows [Version 10.0.19045.1889] (c) Microsoft Corporation. All rights reserved. G:\DWork\osource\cloudc\devops\pulumi\java\docker>where java D:\Apps\Dev\langs\java\jdk\8.x\341\bin\java.exe G:\DWork\osource\cloudc\devops\pulumi\java\docker>where pulumi D:\Apps\Dev\cloudc\devops\pulumi\3.38.0\pulumi.exe G:\DWork\osource\cloudc\devops\pulumi\java\docker>pulumi up Please choose a stack, or create a new one: [Use arrows to move, enter to selecPlease choose a stack, or create a new one: dev Previewing update (dev) View Live: https://app.pulumi.com/nagkumar/docker/dev/previews/aafd47a3-afbb-4ebe-9317-d8b2d4e41967 Type Name Plan Info pulumipulumiStack docker-dev 1 error; 82 messages Diagnostics: pulumipulumiStack (docker-dev): > Task appcompileJava FAILED 1 actionable task: 1 executed error: an unhandled error occurred: 'G:\DWork\osource\cloudc\devops\pulumi\java\docker\gradlew.bat G:\DWork\osource\cloudc\devops\pulumi\java\docker\gradlew.bat run --console=plain' exited with non-zero exit code: 1 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'appcompileJava'. > Could not resolve all files for configuration 'appcompileClasspath'. > Could not resolve com.pulumipulumi0.5.4. Required by: project :app > No matching variant of com.pulumipulumi0.5.4 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but: - Variant 'apiElements' capability com.pulumipulumi0.5.4 declares an API of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs) - Variant 'javadocElements' capability com.pulumipulumi0.5.4 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes:
with jdk 11 it says G:\DWork\osource\cloudc\devops\pulumi\java\docker>where java D:\Apps\Dev\langs\java\jdk\11.x\bin\java.exe G:\DWork\osource\cloudc\devops\pulumi\java\docker>where pulumi D:\Apps\Dev\cloudc\devops\pulumi\3.38.0\pulumi.exe G:\DWork\osource\cloudc\devops\pulumi\java\docker>pulumi up Please choose a stack, or create a new one: [Use arrows to move, enter to selecPlease choose a stack, or create a new one: dev Previewing update (dev) View Live: https://app.pulumi.com/nagkumar/docker/dev/previews/dc1fe895-ad34-40b8-9c51-22670a1ace91 Type Name Plan Info + pulumipulumiStack docker-dev create 22 messages └─ dockerindexRemoteImage mongoImage 1 error Diagnostics: dockerindexRemoteImage (mongoImage): error: could not validate provider configuration: 7 errors occurred: * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key * Invalid or unknown key pulumipulumiStack (docker-dev): Exception in thread "main" java.lang.IllegalArgumentException: Program run without the Pulumi engine available; re-run using the
pulumi
CLI at com.pulumi.deployment.internal.DeploymentImpl$DeploymentState.lambda$fromEnvironment$2(DeploymentImpl.java:1660) at com.pulumi.core.Left.orThrow(Left.java:57) at com.pulumi.deployment.internal.DeploymentImpl$DeploymentState.fromEnvironment(DeploymentImpl.java:1665) at com.pulumi.deployment.internal.DeploymentImpl.fromEnvironment(DeploymentImpl.java:155) at com.pulumi.internal.PulumiInternal.fromEnvironment(PulumiInternal.java:41) at com.pulumi.Pulumi.withOptions(Pulumi.java:51) at com.pulumi.Pulumi.run(Pulumi.java:29) at com.tejasoft.devops.iac.pulumi.docker.DockerPulumiApp.main(DockerPulumiApp.java:12) Caused by: java.lang.IllegalArgumentException: expected environment variable: 'PULUMI_MONITOR', got: [USERDOMAIN_ROAMINGPROFILE, PROCESSOR_LEVEL, SESSIONNAME, ALLUSERSPROFILE, DevEco Studio, PROCESSOR_ARCHITECTURE, PSModulePath, SystemDrive, =ExitCode, DIRNAME, NODE_TLS_REJECT_UNAUTHORIZED, USERNAME, ProgramFiles(x86), VISUALSVN_SERVER, APP_HOME, DEFAULT_JVM_OPTS, PATHEXT, DriverData, BASH_ENV, GOPATH, ProgramData, ProgramW6432, HOMEPATH, SOPC_KIT_NIOS2, PROCESSOR_IDENTIFIER, ProgramFiles, PUBLIC, windir, QUICK_APP, SE_LICENSE_SERVER, OneDriveCommercial, LOCALAPPDATA, USERDOMAIN, LOGONSERVER, JAVA_HOME, PROMPT, WebStorm, CAROOT, =G:, OneDrive, APPDATA, JAVA_EXE, ChocolateyInstall, CommonProgramFiles, Path, OS, COMPUTERNAME, PROCESSOR_REVISION, CLASSPATH, CommonProgramW6432, ComSpec, APP_BASE_NAME, SystemRoot, TEMP, HOMEDRIVE, USERPROFILE, TMP, WSLENV, CommonProgramFiles(x86), QSYS_ROOTDIR, NUMBER_OF_PROCESSORS, QUARTUS_ROOTDIR] at com.pulumi.core.internal.Environment.getEnvironmentVariable(Environment.java:42) ... 6 more FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'apprun'. > Process 'command 'D:\Apps\Dev\langs\java\jdk\11.x\bin\java.exe'' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 2s
I just changed global env both jdk 11 and jdk 8 are installed properly only
I tried with jdk 17 too.. same issue as seen with jdk 11
@freezing-van-87649 any other observations.. any other paths should be kept apart from pulumi,
what is the path of plugins that should be set in the path
for this example all these 7 values needs to be correct..
Copy code
docker:backendPort: "3000"
docker:database: mongodb
docker:frontendPort: "3001"

docker:mongoHost: localhost
docker:mongoPort: "27017"
docker:nodeEnvironment: "18"
docker:protocol: unix
what values are correct that is not listed in documentation
the error message seem to be misleading as it always says monitor not found etc.. however the errors are some thing else
Any GitHub example to tryout docker with pulumi as website code not working
s

stocky-restaurant-98004

08/22/2022, 12:49 PM
Plugins on macOS are stored in
~/.pulumi/plugins
by default. I would assume it's a similar path on Windows.
Resource plugins are named
pulumi-resource-${PROVIDER}.exe
, so the Docker provider is named
pulumi-resource-docker.exe
.
g

gentle-market-22852

08/24/2022, 10:46 AM
2 Views