jolly-airplane-73169
08/11/2025, 7:53 PMerror: getting user info from https://app.pulumi.com: unmarshalling response object: invalid character '<' looking for beginning of value
## What Works
✅ Token validates successfully via API:
bash
curl -H "Authorization: token pul-9d0...948b" \
https://api.pulumi.com/api/user
# Returns valid JSON with user info
✅ Can list organizations via API:
bash
curl -H "Authorization: token pul-9d0...948b" \
https://api.pulumi.com/api/user | jq '.organizations'
# Shows gregk-org and cogzia-org
## What Fails
❌ Method 1: Direct login with token
bash
pulumi login --access-token pul-9d0...948b
_# Initially shows: "Logged in to pulumi.com as gregk"_
_# But then: pulumi whoami_
_# Error: getting user info from https://app.pulumi.com: unmarshalling response object: invalid character '<'_
❌ Method 2: Environment variable
bash
export PULUMI_ACCESS_TOKEN="pul-9d0...948b"
pulumi login
_# Same error as above_
❌ Method 3: Interactive login
bash
pulumi login
_# Opens browser, completes auth successfully_
_# But subsequent commands fail with same error_
❌ Method 4: Direct stack operations
bash
export PULUMI_ACCESS_TOKEN="pul-9d0...948b"
pulumi stack init prod
_# Error: Logging in using access token from PULUMI_ACCESS_TOKEN_
_# error: getting user info from https://app.pulumi.com: unmarshalling response object: invalid character '<'_
## Attempted Mitigations
1. Cleared all state
bash
pulumi logout
rm -rf ~/.pulumi
rm -rf .pulumi
Result: No change
2. Tried different API endpoints
- CLI uses https://app.pulumi.com for user info (fails)
- Direct API calls to https://api.pulumi.com work fine
- Appears to be endpoint mismatch or response format issue
3. Attempted local backend
bash
pulumi login file://~/.pulumi-local
Result: Works, but cannot use organization features
4. Direct API stack creation
- Attempted to create stack via REST API
- Various endpoints return 404 despite valid token
## Root Cause Analysis
The CLI appears to be:
1. Successfully authenticating with the token
2. Then calling https://app.pulumi.com for user info (instead of api.pulumi.com)
3. Receiving HTML (likely a redirect or error page) instead of JSON
4. Failing to parse with "invalid character '<'" error
## Business Impact
We need Infrastructure as Code for our GCP Cloud Run services. Without working Pulumi CLI:
- Cannot manage infrastructure declaratively
- Cannot use team collaboration features
- Cannot integrate with CI/CD
## Expected Resolution
The Pulumi CLI should work with the access token as documented. Specifically:
- pulumi login --access-token <token> should fully authenticate
- pulumi whoami should return user info
- pulumi stack init cogzia-org/cogzia-infrastructure/prod should create stack
## Request
Please investigate why the CLI is:
1. Using app.pulumi.com instead of api.pulumi.com for API calls
2. Receiving HTML responses instead of JSON
3. Unable to complete authentication despite valid token
We'd like to get started with pulumi but this is a big blocker to adoption.echoing-dinner-19531
08/11/2025, 8:04 PMjolly-airplane-73169
08/11/2025, 9:36 PMPulumi.yaml file having:
yaml
backend:
url: https://app.pulumi.com
This caused the CLI to use the wrong endpoint for API calls.
## Solution
1. Removed the backend section from Pulumi.yaml (let it use defaults)
2. Changed project name
3. Re-authenticated with token
## Working Commands
bash
# 1. Logout and clean state
pulumi logout
# 2. Set token and login
export PULUMI_ACCESS_TOKEN="pul-9d0...948b"
pulumi login
# 3. Create stack
pulumi stack init ...
# 4. Configure
..
## Current Status
✅ Authenticated successfully
✅ Stack created
✅ Configuration set
✅ Ready to deploy infrastructure
## View in Console
https://app.pulumi.com/cogzia-org/cogzia-infrastructure/prod
## Next Steps
1. Import existing resources: uv run python pulumi_import.py
2. Preview changes: pulumi preview
3. Deploy: pulumi up
## Lesson Learned
Don't explicitly set backend.url in Pulumi.yaml unless using a custom backend. The default works correctly for Pulumi Cloud Service.