When setting path_inc to redis.path.inc entries created by the redirect module lead to a redirect loop. When you delete the redirect and even disable the redirect module, the page still resolves. Not sure if this should be moved to bug in redirect or if it's actually an issue with this module.

Steps to reproduce:

1) Setup redirect and create a redirect from site.com/path1 to site.com/path2
2) Attempt to resolve site.com/path1 and you'll get a redirect loop
3) Disable redirect module
4) Attempt to resolve site.com/path1 and you'll get the contents of site.com/path2, but not the 301 redirect as expected
5) Remove path_inc override and reenable redirect
6) Attempt to resolve site.com/path1 and you'll get the proper 301 redirect to site.com/path2

Comments

pounard’s picture

Assigned: Unassigned » pounard

Thanks for reporting, I will try to reproduce this bug.

rahu231086’s picture

yes you are absolute right. Redis path cache is incompatible with redirect module. It does not clear path cache when redirect module update or remove redirect url. please resolve this asap.

thanks

pounard’s picture

I will try the sooner I can, sadly I also have a day job so I can't guarantee a date for this. Please be aware that the path storage features remains an experimental component, that's why you actually find nasty bugs :)

I pledge I will fix this, nevertheless probably "not today".

socialnicheguru’s picture

What is the status on this?

joelpittet’s picture

There was a recent release of redirect module, any chance it fixed this?

pounard’s picture

Maybe today, but I cannot guarantee it!

pounard’s picture

I installed Redis 3.x (latest dev version) and Redirect 7.x-1.0-rc2 (released on 2015-Jun-29). Note that Redis was installed and configured before the Redirect module.

1) Setup redirect and create a redirect from site.com/path1 to site.com/path2
2) Attempt to resolve site.com/path1 and you'll get a redirect loop

I did exactly that, and it works perfectly (no redirect loop). Is there anything more that I missed in my procedure ? Note that I did a redirect toward an existing path (node/1 on my test site).

3) Disable redirect module
4) Attempt to resolve site.com/path1 and you'll get the contents of site.com/path2, but not the 301 redirect as expected

Did exactly that, but instead of getting the contents of site.com/path2 I got a 404 not found error. This is the awaited behaviour since that the Redirect module does not call the path_save() method and uses the redirect_url_inbound_alter() to implement its own logic, and bypasses all the core stuff, so once it's disabled, it's not doing its job anymore.

5) Remove path_inc override and reenable redirect
6) Attempt to resolve site.com/path1 and you'll get the proper 301 redirect to site.com/path2

OK, did that and it worked as expected.

I did another test, I removed all cached Redis path data and added back the path.inc replacement, and it worked gracefully.

Please note that I didn't have any path alias in database before testing, I'm going to run the exact same procedure using the exact same node, but adding an alias to it prior to enabling the Redirect module.

pounard’s picture

So, I enabled the path module, cleared the Redis cache, went on my node 1, added an arbitrary alias, then the procedure follows.

1) Setup redirect and create a redirect from site.com/path1 to site.com/path2
2) Attempt to resolve site.com/path1 and you'll get a redirect loop

Did that, and it worked as expected, meaning that the Redirect module did not created an infinite loop, and it redirected on the right path (the node alias).

3) Disable redirect module
4) Attempt to resolve site.com/path1 and you'll get the contents of site.com/path2, but not the 301 redirect as expected

Did that, and I got a 404 not found error, for the exact same reason I detailed in my previous comment, so this is working as expected.

5) Remove path_inc override and reenable redirect
6) Attempt to resolve site.com/path1 and you'll get the proper 301 redirect to site.com/path2

Did it, and it worked.

I removed all cached Redis path data and added back the path.inc replacement, and it worked gracefully.

pounard’s picture

Status: Active » Closed (works as designed)

I have to admit it took awfully long time before I tested this issue. Now that said, here are my conclusions:

  • The Redirect module was known to carry awful bugs that always ended up in infinite redirect loops, I guess they fixed it.
  • The Redirect module does not interfere with Drupal core path alias handling and implements its own logic, so this is not really possible that the Redis path.inc may interfere with it.
  • You should upgrade the Redirect module! If after that you still experience problems, you probably should give more details, how many aliases to do you have on your node/page ? What other modules do you use ? Pathauth ? Global Redirect ? It is highly probable that those kind of bugs might trigger when using multiple modules.