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

URLs in sitemap not correct when generated using cron #16098

Closed
mcyrulik opened this issue Jun 13, 2018 · 4 comments
Closed

URLs in sitemap not correct when generated using cron #16098

mcyrulik opened this issue Jun 13, 2018 · 4 comments
Labels
duplicate 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 Progress: needs update

Comments

@mcyrulik
Copy link

Preconditions

  1. Magento 2.2.4
  2. Apache 2.4
  3. document root set to /pub

Steps to reproduce

  1. Add a sitemap with a path of /pub
  2. Allow cron to generate the sitemap

Expected result

  1. sitemap.xml urls to sitemap should be https://site.com/pub/sitemap-1-1.xml
  2. placeholder image paths should be https://site.com/media/catalog/product/placeholder/default/image.jpg

Actual result

  1. Sitemap.xml urls look like: https://site.com/Documents/WebProjects/www/pub/sitemap1-1.xml
    2 placeholder images appear as https://site.com/pub/static/version1528919727/crontab/_view/en_US/Magento_Catalog/images/product/placeholder/.jpg

If I generate the sitemap through the Magento2 admin, the urls appear as they should.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jun 13, 2018
@sergey-nechaev
Copy link

  1. Same for the 2.2.1
  2. Probably related - sitemap.xml build wrong urls for sitemapindex via cron #9440

@ghost ghost self-assigned this Jul 24, 2018
@ghost
Copy link

ghost commented Jul 24, 2018

Hi @mcyrulik I cannot reproduce by yours scenarios steps, see attachments
selection_035

@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Progress: needs update labels Jul 24, 2018
@hostep
Copy link
Contributor

hostep commented Jul 24, 2018

@engcom-backlog-nazar : this is certainly still reproducible on Magento 2.2.5, I've just tested this again on a clean installation.

Make sure you are generating the sitemap.xml file using the cron system of Magento, by configuring Stores > Configuration > Catalog > XML Sitemap > Generation Settings:

  • Enabled => Yes
  • Start Time => 1 or 2 minutes from your current time

Then execute bin/magento cron:run a couple of times, until the sitemap.xml file gets generated, and then look at the result, you'll see pub in those url's.

But this is actually a duplicate of #5321 & #9111

@mcyrulik : as a temporary fix, you can set these configurations, which will work around the problem:

  • General > Web > Base URLs > Base URL for User Media Files to {{unsecure_base_url}}media/
  • General > Web > Base URLs (Secure) > Base URL for User Media Files to {{secure_base_url}}media/

But then also be aware of a new bug introduced in 2.2.1: #15972

@engcom-backlog-nazar : would be great if Magento would give this a little bit of a higher priority, since this has been an issue for more then 2 years now ...

@ghost ghost added duplicate Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jul 24, 2018
@ghost
Copy link

ghost commented Aug 1, 2018

@mcyrulik closing as duplicate of #5321.

@ghost ghost closed this as completed Aug 1, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate 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 Progress: needs update
Projects
None yet
Development

No branches or pull requests

4 participants