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

str_replace(): Argument #3 ($subject) must be of type array|string, int given #808

Open
Vormillion opened this issue May 17, 2022 · 4 comments
Assignees
Projects

Comments

@Vormillion
Copy link

Preconditions

  1. Magento 2.4.4 EE
  2. PHP 8.1
  3. ece-tools 2002.1.10

Steps to reproduce

  1. In Platform.sh create non-master environment which is child of master.
  2. Wait for deployment and error.

Expected result

  1. Deployment should pass and step "Updating secure and unsecure URLs in app/etc/env.php file" shouldn't break

Actual result

  1. Getting error message on environments where deployment process has to update base_urls:

09:26:32 [2022-05-16T07:26:32.096155+00:00] INFO: Updating secure and unsecure URLs
09:26:32 [2022-05-16T07:26:32.096223+00:00] INFO: Updating secure and unsecure URLs in core_config_data table.
09:26:32 [2022-05-16T07:26:32.098462+00:00] INFO: Updating secure and unsecure URLs in app/etc/env.php file
09:26:32 [2022-05-16T07:26:32.098831+00:00] INFO: Set flag: var/.deploy_is_failed
09:26:32 [2022-05-16T07:26:32.098906+00:00] ERROR: str_replace(): Argument #3 ($subject) must be of type array|string, int given
09:26:32 [2022-05-16T07:26:32.110349+00:00] INFO: Set flag: var/.deploy_is_failed
09:26:32 W:
09:26:32 W: In Processor.php line 129:
09:26:32 W:
09:26:32 W: str_replace(): Argument #3 ($subject) must be of type array|string, int giv
09:26:32 W: en
09:26:32 W:
09:26:32 W:
09:26:32 W: In Environment.php line 94:
09:26:32 W:
09:26:32 W: str_replace(): Argument #3 ($subject) must be of type array|string, int giv
09:26:32 W: en
09:26:32 W:
09:26:32 W:
09:26:32 W: deploy
09:26:32 W:

@andriyShevtsov
Copy link
Contributor

@andriyShevtsov to create internal ticket

@andriyShevtsov andriyShevtsov self-assigned this May 31, 2022
@phoenix-bjoern
Copy link
Contributor

phoenix-bjoern commented Jun 4, 2022

I was able to fix this issue by making sure there is a "http://{default}/" route in .magento/routes.yaml. So there is probably an issue with the MAGENTO_CLOUD_ROUTES variable.
However, I think the code should not assume anything and gracefully handle the situation (or echo an error/hint).

@BaDos
Copy link
Contributor

BaDos commented Jun 29, 2022

@phoenix-bjoern could you provide .magento/routes.yaml to reproduce it?
Just remove this section?

"http://{default}/":
    type: upstream
    upstream: "mymagento:http"

@BaDos
Copy link
Contributor

BaDos commented Jun 29, 2022

The internal task MCLOUD-8941 was created

@m2-community-project m2-community-project bot moved this from Ready for Grooming to Ready for Development in Backlog Aug 3, 2022
sonbui00 added a commit to sonbui00/ece-tools that referenced this issue Oct 30, 2023
str_replace(): Argument magento#3 ($subject) must be of type array|string, int giv

Signed-off-by: Son Bui <sonbv00@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Backlog
Ready for Development
Development

No branches or pull requests

4 participants