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

Theme compilation breaks when mysql host contains port information #38799

Closed
4 tasks
FilipeBicho opened this issue Jun 5, 2024 · 9 comments · Fixed by #38842
Closed
4 tasks

Theme compilation breaks when mysql host contains port information #38799

FilipeBicho opened this issue Jun 5, 2024 · 9 comments · Fixed by #38842
Assignees
Labels
Area: Performance Component: DB Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@FilipeBicho
Copy link

FilipeBicho commented Jun 5, 2024

Preconditions and environment

  • Magento 2.4.7
  • PHP 8.3

Steps to reproduce

  1. Go to env.php
  2. Set the port information to the host in the db connection. e.g. db<'connection']['default']['host'] = 'localhost:3306'
  3. Execute ./magento.sh setup:static-content:deploy

Expected result

The theme is deployed

Actual result

Exception:
Port must be configured within host parameter (like localhost:3306 in /var/www/lehner_dev/src/www/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:464

Additional information

Possible solution:
``{{
diff --git a/DB/Adapter/Pdo/Mysql.php b/DB/Adapter/Pdo/Mysql.php
--- a/DB/Adapter/Pdo/Mysql.php (revision 2dc0b58888392ed5304ac6ad02e36a70e6e490a2)
b/DB/Adapter/Pdo/Mysql.php (date 1717577596939)
@@ -432,6
432,11 @@
$this->parentConnections[] = $this->_connection;
$this->_connection = null;
$this->pid = getmypid();
if (isset($this->*config['port']) && !str_contains($this->config['host'], '/')) {
if (!strcontains($this->*config['host'], ':'))
$this->*config['host'] .= ':' . $this->*config['port'];
unset($this->_config['port']);

  •        }
       }
    
    }
    }}``

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ > Severity: S4 - Affects aesthetics, professional look and feel, "quality" or "usability".
Copy link

m2-assistant bot commented Jun 5, 2024

Hi @FilipeBicho. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@engcom-Delta engcom-Delta added the Reported on 2.4.7 Indicates original Magento version for the Issue report. label Jun 5, 2024
@engcom-Delta engcom-Delta self-assigned this Jun 5, 2024
Copy link

m2-assistant bot commented Jun 5, 2024

Hi @engcom-Delta. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Delta
Copy link
Contributor

Hi @FilipeBicho ,

Thanks for reporting and collaboration.

Verified the issue in magento 2.4-develop and 2.4.7 instance and the issue is not reproducible.

Steps to reproduce:-

1.Go to app-> etc->env.php
2.Set the port information to the host in the db connection. e.g. db['connection']['default']['host'] = 'localhost:3306'
3.Execute php bin/magento setup:static-content:deploy

Please refer the attached screenshots and let us know if we missed anything.

Screenshot 2024-06-07 at 12 46 00 AM

No error

Screenshot 2024-06-07 at 1 40 51 AM

@engcom-Delta engcom-Delta added the Issue: needs update Additional information is require, waiting for response label Jun 6, 2024
@mrodespin
Copy link
Contributor

mrodespin commented Jun 17, 2024

I reproduced this error on a Magento Project that we recently updated to 2.4.7-p1.
The steps to reproduce the error are:

  1. Flush the Magento cache, e.g. bin/magento c:f
  2. Set the port information to the host in the db connection. e.g. db['connection']['default']['host'] = 'localhost:3306'
  3. Run the compilation command using different jobs, like the following example

bin/magento setup:static-content:deploy --force --strategy standard --jobs 4

While this bug is not fixed there is a workaround to compile statics properly without using --jobs param

@engcom-Delta
Copy link
Contributor

Hi @FilipeBicho ,

Verified the issue on 2.4.7 and it is reproducible.

Hence, Confirming the issue.

Steps to reproduce:-

1.Flush the Magento cache, e.g. bin/magento c:f
2.Go to app-> etc->env.php
3.Set the port information to the host in the db connection. e.g. db['connection']['default']['host'] = 'localhost:3306'
4.bin/magento setup:static-content:deploy --force --strategy standard --jobs 4

Flush the Magento cache

Screenshot 2024-06-18 at 8 04 33 PM

Set the port information to the host in the db connection. e.g. db['connection']['default']['host'] = 'localhost:3306'

Screenshot 2024-06-18 at 8 05 22 PM

Run bin/magento setup:static-content:deploy --force --strategy standard --jobs 4

Screenshot 2024-06-18 at 8 06 26 PM

@engcom-Delta engcom-Delta added Component: DB Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Performance Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jun 18, 2024
@m2-community-project m2-community-project bot removed the Issue: needs update Additional information is require, waiting for response label Jun 18, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-12176 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Jun 18, 2024

✅ Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@mrodespin
Copy link
Contributor

I opened a PR to fix this issue -> #38842

@m2-community-project m2-community-project bot added the Priority: P3 May be fixed according to the position in the backlog. label Jun 20, 2024
@falko100
Copy link

falko100 commented Aug 1, 2024

Encountered the same problem. PR works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Performance Component: DB Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants