Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctrine migrations immediately aborted in 5.0.5 and 4.4.5 #35988

Closed
jacekpl opened this issue Mar 6, 2020 · 5 comments
Closed

Doctrine migrations immediately aborted in 5.0.5 and 4.4.5 #35988

jacekpl opened this issue Mar 6, 2020 · 5 comments

Comments

@jacekpl
Copy link

jacekpl commented Mar 6, 2020

Symfony version(s) affected: 5.0.5 and 4.4.5

Description
Yesterday I updated some of my projects to the newest versions of Symfony. I noticed that both in Github Actions and Bitbucket Pipelines my CI/CD process failed (with no other code changes made). After downgrading back to 4.4.4 and 5.0.4 everything went fine.

How to reproduce
Create Symfony project in the newest version in Bitbucket or Github with enabled CI/CD and mysql + sample migration. I've created sample repository with minimal code possible to show how it looks like.

Master branch (5.0.5): https://github.com/jacekpl/symfony-migrations-issue
Failed pipeline for master: https://github.com/jacekpl/symfony-migrations-issue/runs/490266168?check_suite_focus=true

Delevop branch (5.0.4): https://github.com/jacekpl/symfony-migrations-issue/tree/develop
Ok pipeline for develop: https://github.com/jacekpl/symfony-migrations-issue/runs/490130516?check_suite_focus=true

Additional context
Expected bahaviour:

                    Application Migrations                    
                                                              

Migrating up to 20200306090544 from 0

  ++ migrating 20200306090544

     -> CREATE TABLE test (id INT AUTO_INCREMENT NOT NULL, message VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB

  ++ migrated (took 32.8ms, used 28M memory)

  ------------------------

  ++ finished in 34.5ms
  ++ used 28M memory
  ++ 1 migrations executed
  ++ 1 sql queries

Actual behaviour in 5.0.5:

                    Application Migrations                    
                                                              

WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)
            
  Aborted.  
@jacekpl jacekpl added the Bug label Mar 6, 2020
@Tobion
Copy link
Member

Tobion commented Mar 6, 2020

This is a change in doctrine migrations, not Symfony. All you need to do is add --no-interaction as option to the migration command so it does not try to ask for confirmation.

@Tobion Tobion closed this as completed Mar 6, 2020
@jacekpl
Copy link
Author

jacekpl commented Mar 6, 2020

--no-interaction will fix it, but the behaviour has changed between patch versions (and probably it shouldn't).

@ElisDN
Copy link

ElisDN commented Mar 10, 2020

@Tobion No, it is a change in Symfony #33897, not Migrations. It breaks all composer app ... calls.

@bendavies
Copy link
Contributor

adding --no-interaction is not the solution. #33897 should be reverted.

@faizanakram99
Copy link
Contributor

I also found it after upgrading to sf 4.4.5 but just added -n in our build scripts to fix this.
It is easy but it is still a BC break in minor minor version upgrade which is not optimal imho.

fabpot added a commit that referenced this issue Mar 16, 2020
…input (ostrolucky)

This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fallback to default answers when unable to read input

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36027, Fix #35988
| License       | MIT
| Doc PR        |

Alternative to #36027.

This fixes linked issues without having to revert fix for #30726. Successfully tested with composer script, `docker run` and `docker run -it`.

Commits
-------

8ddaa20 [Console] Fallback to default answers when unable to read input
@fabpot fabpot closed this as completed Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants