Troubleshooting
Common issues and solutions for Pulumi Any Terraform providers
This guide covers common issues you might encounter when using Pulumi Any Terraform providers and how to resolve them.
Installation Issues
pnpm/npm Installation Fails
Problem: Package installation fails with network errors
ERR_PNPM_FETCH_404Solutions:
- Check your internet connection
- Clear npm cache:
npm cache clean --force - Clear pnpm cache:
pnpm store prune - Try using a different registry mirror
- Check if the package exists:
npm view pulumi-namecheap
Dependency Conflicts
Problem: Conflicting peer dependencies
ERESOLVE unable to resolve dependency treeSolutions:
- Update Pulumi CLI:
pulumi upgrade - Use
--legacy-peer-depsflag:npm install --legacy-peer-deps - Check package.json for version conflicts
- Update @pulumi/pulumi to latest compatible version
TypeScript Version Issues
Problem: TypeScript compilation errors
error TS2307: Cannot find module 'pulumi-namecheap'Solutions:
- Ensure TypeScript version matches requirements (5.x)
- Install @types packages:
npm install @types/node - Check tsconfig.json configuration
- Rebuild:
npm run build
Configuration Issues
Provider Authentication Fails
Problem: API authentication errors
Error: Authentication failed: Invalid API keySolutions:
- Verify credentials are correct
- Check environment variables are set:
echo $NAMECHEAP_API_KEY - Use Pulumi config:
pulumi config get namecheap:apiKey - Ensure secret flag is used:
pulumi config set key value --secret - Check IP whitelist settings (for providers that require it)
Missing Configuration
Problem: Required configuration not set
Error: Missing required configuration 'apiKey'Solutions:
- Set missing configuration:
pulumi config set provider:key value - Check for typos in config keys
- Verify stack is selected:
pulumi stack select - Review provider documentation for required config
Environment Variable Not Loaded
Problem: Environment variables not recognized
Solutions:
- Export variables in current shell:
export KEY=value - Add to
.envfile (if supported) - Check variable name matches provider expectations
- Restart terminal/IDE after setting variables
Runtime Issues
Resource Creation Fails
Problem: Resource fails to create
Error: creating Resource: API errorSolutions:
- Enable debug logging:
pulumi up --logtostderr -v=9 - Check API rate limits
- Verify resource parameters are valid
- Check provider API status
- Review API documentation for constraints
State Conflicts
Problem: State file conflicts
Error: resource already exists in stateSolutions:
- Refresh state:
pulumi refresh - Import existing resource:
pulumi import - Remove from state:
pulumi state delete - Check for duplicate resources in code
Timeout Errors
Problem: Operations timeout
Error: timeout waiting for resource to become readySolutions:
- Increase timeout in resource options
- Check network connectivity
- Verify external service is available
- Review provider API performance
Update Failures
Problem: Resource update fails
Error: updating Resource: conflictSolutions:
- Run
pulumi refreshfirst - Check for manual changes outside Pulumi
- Review resource locking mechanisms
- Verify update is allowed by provider
Type Safety Issues
Type Errors in TypeScript
Problem: Type checking errors
Type 'string' is not assignable to type 'Input<string>'Solutions:
- Use proper Input types:
pulumi.Input<string> - Use
pulumi.output()for transformations - Check for type mismatches in args
- Regenerate types if stale
Missing Type Definitions
Problem: No IntelliSense or autocomplete
Solutions:
- Ensure package is installed correctly
- Restart TypeScript language server
- Check types are exported properly
- Verify tsconfig.json includes node_modules
Performance Issues
Slow Deployments
Problem: pulumi up takes too long
Solutions:
- Use
--parallelflag for concurrent operations - Reduce resource count per stack
- Check network latency to provider APIs
- Enable Pulumi state caching
- Review resource dependencies
Build Performance
Problem: Build times are slow
Solutions:
- Use Nx caching:
nx resetthen rebuild - Enable incremental TypeScript compilation
- Reduce package size
- Update Node.js and TypeScript versions
Debugging
Enable Debug Logging
Enable comprehensive logging:
# Pulumi debug logs
export PULUMI_DEBUG_COMMANDS=true
export PULUMI_DEBUG_PROMISE_LEAKS=true
pulumi up --logtostderr -v=9
# Terraform provider logs
export TF_LOG=DEBUG
export TF_LOG_PATH=./terraform.logInspect State
# View current state
pulumi stack export
# View specific resource
pulumi stack export | jq '.deployment.resources[] | select(.type=="namecheap:index:Record")'
# List all resources
pulumi stack --show-urnsTest Provider Connection
import * as pulumi from "@pulumi/pulumi";
pulumi.log.info("Testing provider connection...");
// Try a simple operation
const test = new Provider("test", {
// minimal config
});
pulumi.log.info("Provider initialized successfully");Provider-Specific Issues
Namecheap: IP Not Whitelisted
Problem: API access denied
Solution: Add your IP to Namecheap API whitelist in account settings
Better Uptime: Rate Limiting
Problem: Too many requests
Solution: Reduce check frequency or contact support for higher limits
Bunnynet: Region Not Available
Problem: Storage region unavailable
Solution: Check Bunny.net documentation for available regions
Infisical: Token Expired
Problem: Service token expired
Solution: Generate new service token in Infisical dashboard
Portainer: Connection Refused
Problem: Cannot connect to Portainer
Solution: Verify Portainer URL and check firewall rules
Common Error Messages
"Resource not found"
Cause: Resource was deleted outside Pulumi
Solution:
pulumi refresh # Sync state with reality
# or
pulumi state delete urn # Remove from state"Concurrent update detected"
Cause: Multiple users updating same stack
Solution:
pulumi cancel # Cancel conflicting update
pulumi refresh # Sync state
pulumi up # Retry"Output cannot be used in input"
Cause: Using Output type where Input type expected
Solution:
// Wrong
const value = output.value;
// Correct
const value = pulumi.output(someOutput).apply(v => v);"Secret must be encrypted"
Cause: Plain text used for secret value
Solution:
pulumi config set key value --secretBest Practices to Avoid Issues
1. Always Use Version Constraints
{
"dependencies": {
"pulumi-namecheap": "^2.0.0" // Use caret for compatible updates
}
}2. Pin Critical Dependencies
{
"devDependencies": {
"@pulumi/pulumi": "3.205.0" // Exact version for stability
}
}3. Use Separate Stacks
pulumi stack init dev
pulumi stack init staging
pulumi stack init production4. Implement Resource Protection
const criticalResource = new Resource("critical", {
// ...
}, {
protect: true // Prevent accidental deletion
});5. Use Stack References
const networkStack = new pulumi.StackReference("org/network/prod");
const vpcId = networkStack.getOutput("vpcId");6. Regular State Refreshes
# Before major operations
pulumi refresh
pulumi preview
pulumi upGetting Additional Help
Check Documentation
- Provider-specific documentation in this site
- Pulumi Documentation
- Terraform provider documentation
- Provider API documentation
Community Support
- GitHub Issues: Report bugs
- Pulumi Community Slack: Get help from the community
- Stack Overflow: Search for similar issues
Reporting Bugs
When reporting bugs, include:
- Provider and version:
pulumi-namecheap@2.2.13 - Pulumi version:
pulumi version - Node.js version:
node --version - Error message: Full error output
- Minimal reproduction: Simplified code that reproduces the issue
- Environment: OS, shell, terminal
- Steps to reproduce: Clear instructions
Example Bug Report
**Provider**: pulumi-namecheap@2.2.13
**Pulumi**: 3.205.0
**Node.js**: v22.18.0
**OS**: Ubuntu 22.04
**Issue**: DNS record creation fails with timeout
**Error**:Error: creating Record: timeout waiting for completion
**Code**:
```typescript
const record = new namecheap.Record("test", {
domain: "example.com",
hostname: "test",
type: "A",
address: "192.168.1.1",
});Steps:
- Run
pulumi up - See timeout after 5 minutes
- Record is not created in Namecheap dashboard
Expected: Record should be created successfully
## Preventive Measures
### Regular Maintenance
```bash
# Weekly
pulumi refresh # Sync state
pnpm update # Update dependencies
# Monthly
pulumi stack export --file backup.json # Backup state
pnpm outdated # Check for updatesMonitoring
Set up monitoring for:
- Resource health
- API quota usage
- Stack update frequency
- Error rates
Documentation
Keep internal documentation for:
- Custom resource patterns
- Team conventions
- Known issues and workarounds
- Deployment procedures
Quick Reference
| Issue | Quick Fix |
|---|---|
| State out of sync | pulumi refresh |
| Build cache issues | pnpm nx reset |
| Dependency conflicts | pnpm install --force |
| Config not found | pulumi config set key value |
| Import existing resource | pulumi import type name id |
| Cancel stuck update | pulumi cancel |
| View state | pulumi stack export |
| Debug logging | pulumi up -v=9 |