dosubot[bot] commented on issue #8693: URL: https://github.com/apache/incubator-devlake/issues/8693#issuecomment-3837338618
<!-- Greeting --> Hi @zachspar! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the incubator-devlake team. <!-- Answer --> This error happens because the database migration adds a token_expires_at column, but the Go struct used for onboarding doesn't include or set this field. As a result, when a new GitHub connection is created, MySQL tries to insert its zero value ('0000-00-00') for a NOT NULL DATETIME column, which is invalid in strict SQL modes and causes the error you see. This is a known class of issue and has affected other datetime fields in previous versions as well ([example](https://github.com/apache/incubator-devlake/issues/8490)). A fix for token management and the token_expires_at field was merged recently ([PR #8667](https://github.com/apache/incubator-devlake/pull/8667)), so this should be resolved in a future release. For v1.0.3-beta9, you can work around this by either altering the _tool_github_connections table to allow NULL for token_expires_at, or by manually setting a valid default value (like CURRENT_TIMESTAMP) for that column in your database schema. There is no official workaround documented for this version, but these steps are based on the migration and model analysis. If possible, keep an eye out for the next release and consider upgrading when it's available. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/238ee901-ed26-49e3-8b85-5f3695eb47d8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/238ee901-ed26-49e3-8b85-5f3695eb47d8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/238ee901-ed26-49e3-8b85-5f3695eb47d8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/238ee901-ed26-49e3-8b85-5f3695eb47d8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/238ee901-ed26-49e3-8b85-5f3695eb47d8?feedback_type=hallucination) | [Report š](https://app.dosu.dev/response-feedback/238ee901-ed26-49e3-8b85-5f3695eb47d8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/238ee901-ed26-49e3-8b85-5f3695eb47d8?feedback_type=other)</sup> [](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github) [](https://cursor.com/link/prompt?text=This%20error%20happens%20because%20the%20database%20migration%20adds%20a%20token_expires_at%20column%2C%20but%20the%20Go%20struct%20used%20for%20onboarding%20doesn%27t%20include%20or%20set%20this%20field.%20As%20a%20result%2C%20when%20a%20new%20GitHub%20connection%20is%20created%2C%20MySQL%20tries%20to%20insert%20its%20zero%20value%20%28%270000-00-00%27%29%20for%20a%20NOT%20NULL%20DATETIME%20column%2C%20which%20is%20invalid%20in%20strict%20SQL%20modes%20and%20causes%20the%20error%20you%20see.%20This%20is%20a%20known%20class%20of%20issue%20and%20has%20affected%20other%20datetime%20fields%20in%20previous%20versions%20as%20well%20%28%5Bexample%5D%28https%3A//github.com/apache/incubator-devlake/issues/8490%29%29.%0A%0AA%20fix%20for%20token%20management %20and%20the%20token_expires_at%20field%20was%20merged%20recently%20%28%5BPR%20%238667%5D%28https%3A//github.com/apache/incubator-devlake/pull/8667%29%29%2C%20so%20this%20should%20be%20resolved%20in%20a%20future%20release.%20For%20v1.0.3-beta9%2C%20you%20can%20work%20around%20this%20by%20either%20altering%20the%20_tool_github_connections%20table%20to%20allow%20NULL%20for%20token_expires_at%2C%20or%20by%20manually%20setting%20a%20valid%20default%20value%20%28like%20CURRENT_TIMESTAMP%29%20for%20that%20column%20in%20your%20database%20schema.%20There%20is%20no%20official%20workaround%20documented%20for%20this%20version%2C%20but%20these%20steps%20are%20based%20on%20the%20migration%20and%20model%20analysis.%20%0A%0AIf%20possible%2C%20keep%20an%20eye%20out%20for%20the%20next%20release%20and%20consider%20upgrading%20when%20it%27s%20available.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8693) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
