pulumi / pulumi/pulumi-java

PANIC=Format method: interface conversion: model.Expression is *model.TemplateExpression, not *model.LiteralValueExpression

Open
#1,805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/codegen kind/bug
Dominant language
Java
Stars
85
Forks
26
Avg merge
11h 49m
Merged PRs (30d)
22

Description

What happened?

Similar to https://github.com/pulumi/pulumi-java/issues/1354 and https://github.com/pulumi/pulumi-java/issues/1349.

Example
  1. Clone the pulumi-docker-build repo and navigate towards this example YAML: https://github.com/pulumi/pulumi-docker-build/blob/main/examples/yaml/Pulumi.yaml

  2. Generate Java from the YAML:

pulumi convert \
    --logtostderr \
    --generate-only \
    --non-interactive \
    --language java \
    --generate-only \
    --non-interactive \
    --out java
  1. Observe the generated SDK includes a panic:
❯ rg PANIC
java/src/main/java/generated_program/App.java
157:%!v(PANIC=Format method: interface conversion: model.Expression is *model.TemplateExpression, not *model.LiteralValueExpression)))
Output of pulumi about

❯ pulumi about
CLI
Version 3.169.0
Go Version go1.24.3
Go Compiler gc

Plugins
KIND NAME VERSION
resource docker-build unknown
language yaml 1.19.0

Host
OS darwin
Version 15.4.1
Arch arm64

This project is written in yaml

Backend
Name pulumi.com
URL https://app.pulumi.com/bryce-pulumi-corp
User bryce-pulumi-corp
Organizations bryce-pulumi-corp, pulumi
Token type personal

Dependencies:
NAME VERSION
docker-build

Pulumi locates its logs in /var/folders/kq/zdlx0fn57yl66gxktcyzylv40000gn/T/ by default
warning: Failed to get information about the current stack: No current stack

Additional context

More of the generated SDK output:

        var namedContexts = new Image("namedContexts", ImageArgs.builder()
            .push(false)
            .dockerfile(DockerfileArgs.builder()
                .location("./app/Dockerfile.namedContexts")
                .build())
            .context(BuildContextArgs.builder()
                .location("./app")
                .named(Map.of(k1: "golang:latest", ContextArgs.builder()
%!v(PANIC=Format method: interface conversion: model.Expression is *model.TemplateExpression, not *model.LiteralValueExpression)))
                    .build())
                .build());
Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

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.

Research direction

Reproduce the issue with the pulumi-docker-build YAML example and the shown pulumi convert command, then inspect generated_program/App.java around line 157. Trace Java generation where a model.TemplateExpression is handled as a model.LiteralValueExpression; done means the generated Java contains valid output without the PANIC formatting text.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.