What's broken:
- Users can create bounties successfully ✅
- When they try to PAY for the bounty, they get "Failed to process payment" ❌
- Server returns 500 Internal Server Error
- This has been reported multiple times
Root cause:
The database is missing the blockchain_bounty_id column that the code expects.
Branch: phase-2-security-implementation
What it includes:
- Database migration that adds the missing column
- Updated TypeScript types
- Better error handling and user experience
cd /path/to/Roxonn-Platform
git fetch origin
git checkout phase-2-security-implementation
git pull origin phase-2-security-implementation-- Add the missing column
ALTER TABLE community_bounties
ADD COLUMN IF NOT EXISTS blockchain_bounty_id INTEGER;
-- Add documentation
COMMENT ON COLUMN community_bounties.blockchain_bounty_id IS
'On-chain bounty ID from CommunityBountyEscrow.sol, used by relayer to complete payouts';
-- Add index for performance
CREATE INDEX IF NOT EXISTS idx_community_bounties_blockchain_id
ON community_bounties(blockchain_bounty_id)
WHERE blockchain_bounty_id IS NOT NULL;Or run the migration file directly:
psql -U your_user -d your_database -f migrations/0024_add_blockchain_bounty_id.sql# However you normally restart (examples):
pm2 restart all
# OR
systemctl restart roxonn-server
# OR
docker-compose restart- Go to https://app.roxonn.com/community-bounties
- Login with GitHub
- Create a test bounty
- Click "Pay" button
- Should work without 500 error
migrations/0024_add_blockchain_bounty_id.sql ← THE CRITICAL FIX
shared/schema.ts ← TypeScript schema
client/src/pages/community-bounties-page.tsx ← Better UX
client/src/lib/community-bounties-api.ts ← TypeScript types
Error from production:
POST https://app.roxonn.com/api/community-bounties/31/pay
Status: 500 Internal Server Error
Bounty ID 31 was created successfully, but payment failed because the database doesn't have the column the code needs.
Someone added blockchainBountyId to the TypeScript code but never ran the database migration on production. Local/dev worked fine because migrations were run there, but production database was left behind.
Time to fix: ~5 minutes Impact if not fixed: Bounty payments remain broken Risk of fix: Very low - just adds a nullable column
Any questions? The code is ready, tested, and pushed to GitHub.