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

"x_forwarded_for" value is always empty in Order object. #7227

Closed
ytorbyk opened this issue Oct 28, 2016 · 8 comments
Closed

"x_forwarded_for" value is always empty in Order object. #7227

ytorbyk opened this issue Oct 28, 2016 · 8 comments
Assignees
Labels
bug report Component: Checkout Event: distributed-cd Distributed Contribution Day Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release up for grabs

Comments

@ytorbyk
Copy link
Member

ytorbyk commented Oct 28, 2016

Developer branch used

Preconditions

  1. This scenario i quiet difficult to reproduce since $_SERVER['HTTP_X_FORWARDED_FOR'] must be available.

Steps to reproduce

  1. Place any order

Expected result

  1. "x_forwarded_for" field must contain that value from $_SERVER['HTTP_X_FORWARDED_FOR']

Actual result

  1. "x_forwarded_for" field is always empty

Thoughts

I've tried to find out why it happens.
I found that this field is never set directly to order. It could be copied from quote during conversion quote to order. However quote does't have such field in DB. The field is set to quote each time the quote is got from checkout session.
https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Model/Session.php#L280
But on order placement process quote is got not from session but from DB.
https://github.com/magento/magento2/blob/develop/app/code/Magento/Quote/Model/QuoteManagement.php#L325

@veloraven
Copy link
Contributor

@ytorbyk thank you for your report.
Please, update formatting of this issue as it is hard to read now.
Please, also identify which version of Magento you are running.

@ytorbyk
Copy link
Member Author

ytorbyk commented Oct 31, 2016

@veloraven I apologize for the issue format. It's already updated.

@Silarn
Copy link

Silarn commented Feb 13, 2017

I guess #8203 is a duplicate of this. For some reason I didn't come up with this issue when I did a search initially. I diagnosed basically the same reasons for the problem and possible fixes. However there's also some incompatibilities with IPv6 addresses that should be addressed.

@zack6849
Copy link
Contributor

Did anything ever come of this bug report?

@magento-engcom-team
Copy link
Contributor

@ytorbyk, thank you for your report.
We've acknowledged the issue and added to our backlog.

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Mar 7, 2018
ebanolopes pushed a commit to signifyd/magento2 that referenced this issue Dec 6, 2018
magento/magento2#7227
x_forwarded_for should be copied from quote, but quote does not have the
field on database
@jaywilliams
Copy link
Contributor

For those of you who want to see their customer's actual IP addresses, as opposed to 127.0.0.1, and don't want to wait for Magento to fix this rather critical piece to help identify fraudulent orders, there is a simple solution:

https://dev98.de/2017/01/02/how-to-add-alternative-http-headers-to-magento-2/

@cmuench cmuench self-assigned this Mar 16, 2019
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Mar 16, 2019

Hi @cmuench. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

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

    Details- Add the comment @magento-engcom-team 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!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@magento-engcom-team
Copy link
Contributor

Hi @ytorbyk. Thank you for your report.
The issue has been fixed in #21787 by @cmuench in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.2 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Apr 26, 2019
magento-engcom-team added a commit that referenced this issue Apr 26, 2019
…mpty in Order object #21787

 - Merge Pull Request #21787 from cmuench/magento2:x-forwarded-for-in-order
 - Merged commits:
   1. 6ce9ee7
magento-engcom-team added a commit that referenced this issue Apr 26, 2019
…mpty in Order object #21787

 - Merge Pull Request #21787 from cmuench/magento2:x-forwarded-for-in-order
 - Merged commits:
   1. 6ce9ee7
   2. 056b526
   3. c4e4cbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Checkout Event: distributed-cd Distributed Contribution Day Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release up for grabs
Projects
None yet
Development

No branches or pull requests

8 participants