Skip to content

Conversation

@something-something-something
Copy link
Contributor

@something-something-something something-something-something commented Oct 15, 2025

Description

Explanation of bug:
When trying to run the lite docker container using

docker run -p 8801:8801 -p 7233:7233 -p 8233:8233 -e AUTO_FIX_WORKER_URL=host.docker.internal --add-host host.docker.internal:host-gateway -it iworkflowio/iwf-server-lite:latest

It exits and I get this error

2025/10/15 00:43:46 bucket created successfully: iwf-test-bucket
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /                         --> github.com/indeedeng/iwf/service/api.(*handler).index-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/start    --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowStart-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/waitForStateCompletion --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowWaitForStateCompletion-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/signal   --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowSignal-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/publishToInternalChannel --> github.com/indeedeng/iwf/service/api.(*handler).apiV1PublishToInternalChannel-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/dataobjects/get --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowGetDataAttributes-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/dataobjects/set --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowSetDataAttributes-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/searchattributes/get --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowGetSearchAttributes-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/searchattributes/set --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowSetSearchAttributes-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/get      --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowGet-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/getWithWait --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowGetWithWait-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/search   --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowSearch-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/reset    --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowReset-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/stop     --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowStop-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/timer/skip --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowSkipTimer-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/internal/dump --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowInternalDump-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/config/update --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowConfigUpdate-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/triggerContinueAsNew --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowTriggerContinueAsNew-fm (3 handlers)
[GIN-debug] POST   /api/v1/workflow/rpc      --> github.com/indeedeng/iwf/service/api.(*handler).apiV1WorkflowRpc-fm (3 handlers)
[GIN-debug] GET    /info/healthcheck         --> github.com/indeedeng/iwf/service/api.(*handler).infoHealthCheck-fm (3 handlers)
[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
[GIN-debug] Listening and serving HTTP on :8801
2025/10/15 00:43:46 failed to create bucket{{error 26 0  0xc000a86c30}}

Note how both 2025/10/15 00:43:46 bucket created successfully: iwf-test-bucket and 2025/10/15 00:43:46 failed to create bucket{{error 26 0 0xc000a86c30}} are loged

from what I can tell this ends up invoking createBucketIfNotExists twice (for interpreter and api) in parallel. Both detect that the bucket is missing one creates the bucket and the other fails to create the bucket because it already exists.

for _, svcName := range services {
			go launchTemporalService(svcName, *config, unifiedClient, temporalClient, logger, metrics)
		}

Checklist

  • Code compiles correctly
  • Tests for the changes have been added
  • All tests passing
  • This PR change is backwards-compatible
  • This PR CONTAINS a (planned) breaking change (it is not backwards compatible)

Related Issue

Closes #issue_number

@something-something-something something-something-something force-pushed the fix-race-condition-when-creating-bucket branch from 1cf2223 to 28177cb Compare October 15, 2025 02:21
@ktrops
Copy link
Contributor

ktrops commented Oct 28, 2025

changing bitnami to bitnamilegacy in all of the docker-compose/ dependencies.ymls should make the tests pass.

@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.58%. Comparing base (fb741d0) to head (efa30b3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #594      +/-   ##
==========================================
- Coverage   66.35%   65.58%   -0.77%     
==========================================
  Files          65       65              
  Lines        7564     6431    -1133     
==========================================
- Hits         5019     4218     -801     
+ Misses       2220     1888     -332     
  Partials      325      325              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@something-something-something
Copy link
Contributor Author

changing bitnami to bitnamilegacy in all of the docker-compose/ dependencies.ymls should make the tests pass.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants