Skip to content

Invalid parameter given. A valid $fileId[tmp_name] is expected #25835

Open
@OleksiyOleksiyovych

Description

@OleksiyOleksiyovych

Preconditions (*)

  1. Magento 2.3.3

Steps to reproduce (*)

  1. Login into the admin panel
  2. Go to Stores - Settings - Configuration.
  3. Open tab Catalog - Catalog. Fieldset "Product Image Placeholders".
  4. Select the placeholder image for field "Base"
  5. Click to button "Save"
    You can try another setting with type "file"

Expected result (*)

Screen Shot 2019-11-29 at 10 14 52 AM
Error message: Invalid parameter given. A valid $fileId[tmp_name] is expected.

Actual result (*)

  1. File uploaded and the configuration saved without errors

Issue reason

The reason for this issue is additional validation - function validateFileId
In this function we have check is uploaded file located in "correnct" tmp dicartory.
sys_get_temp_dir() get folder /tmp
$_FILES["file"]["tmp_name"] located in folder /chroot/home/tmp/xxxxxxx
Nexcess support said: "This actually makes sense, because /tmp is a symbolic link to /chroot/home/tmp on our servers."

Possible fixes

  1. [Correct way] Configure upload_tmp_dir to an allowed folder:
  • "var/tmp" (or another based on sys_get_temp_dir() value)
  • "<magento_root>/pub/media"
  • "<magento_root>/var"
  • "<magento_root>/var/tmp"
  • "<magento_root>/pub/media/upload"

But it can be not so easy (impossible). For example, we have issue on Nexcess server. Server support responce:

sys_get_temp_dir: /tmp
$_FILES["file"]["tmp_name"]: /chroot/home/tmp/phpPEOxFn
This actually makes sense, because /tmp is a symbolic link to /chroot/home/tmp on our servers.

  1. [Hotfix] Add preference for class Magento/Framework/File/Uploader.php and remove validateFileId logic. You can not add a preference for this file.

  2. [Hotfix v2] Add custom patch. How to apply here. Patch here

Activity

m2-assistant

m2-assistant commented on Nov 29, 2019

@m2-assistant

Hi @OleksiyOleksiyovych. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
    Information on your environment
    Steps to reproduce
    Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@OleksiyOleksiyovych do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
    no

omaxmo

omaxmo commented on Nov 29, 2019

@omaxmo
Contributor

@magento give me 2.3-develop instance

magento-engcom-team

magento-engcom-team commented on Nov 29, 2019

@magento-engcom-team
Contributor

Hi @omaxmo. Thank you for your request. I'm working on Magento 2.3-develop instance for you

magento-engcom-team

magento-engcom-team commented on Nov 29, 2019

@magento-engcom-team
Contributor

Hi @omaxmo, here is your Magento instance.
Admin access: https://i-25835-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

OleksiyOleksiyovych

OleksiyOleksiyovych commented on Nov 29, 2019

@OleksiyOleksiyovych
Author

I can not reproduce it on vanilla Magento instance which Magneto provides to test, but it's reproducible on vanilla Magento on other servers (for example, Nexcess).
Can someone provide steps for server configuration?

m2-assistant

m2-assistant commented on Nov 29, 2019

@m2-assistant

Hi @engcom-Charlie. 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).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

    2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

    3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

    4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.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.

added
Issue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passed
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Reproduced on 2.3.xThe issue has been reproduced on latest 2.3 release
on Nov 29, 2019
Repository owner unassigned on Nov 29, 2019
magento-engcom-team

magento-engcom-team commented on Nov 29, 2019

@magento-engcom-team
Contributor

✅ Confirmed by @engcom-Charlie
Thank you for verifying the issue. Based on the provided information internal tickets MC-29272 were created

Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

45 remaining items

added
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
on Jan 19, 2023
removed
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
on Jan 19, 2023
github-jira-sync-bot

github-jira-sync-bot commented on Jan 19, 2023

@github-jira-sync-bot

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

added
Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
on Jan 19, 2023
github-jira-sync-bot

github-jira-sync-bot commented on Jan 19, 2023

@github-jira-sync-bot

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

m2-assistant

m2-assistant commented on Jan 19, 2023

@m2-assistant

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

moved this to Pull Request In Progress in Low Priority Backlogon Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Admin UIComponent: FilesystemIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedPriority: P3May be fixed according to the position in the backlog.Progress: PR in progressReported on 2.3.3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Vinai@hostep@niclashoyer@xxorax@WinstonN

      Issue actions

        Invalid parameter given. A valid $fileId[tmp_name] is expected · Issue #25835 · magento/magento2