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

some redirected/renamed node URLs broken #802

Closed
jywarren opened this issue Sep 7, 2016 · 11 comments
Closed

some redirected/renamed node URLs broken #802

jywarren opened this issue Sep 7, 2016 · 11 comments
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed

Comments

@jywarren
Copy link
Member

jywarren commented Sep 7, 2016

What happened just before the problem occurred

I wanted to go to:

https://publiclab.org/notes/liz/08-03-2011/infrared-balloon-image-reveals-gowanus-plume

But I found that the post only exists now at:

https://publiclab.org/notes/liz/8-3-2011/ir-reveals-gowanus-plume

This page is also possibly broken: https://publiclab.org/notes/hunter/7-19-2012/irvs-timelapse

We used to use redirect records to allow multiple URLs to point to (redirect to) the same node. What I believe is happening is that the redirect records are not working anymore? Also see removal of the legacy DrupalUrlRedirect system in #73 -- specifically this comment: #73 (comment)

This could also relate to more recent wiki path issues in #697.


Update: according to the comment above, some nodes in the pre-friendly_id db should be findable with: DrupalNode.find_all_by_path 'DUPLICATE' and some marked as redirects with their type as redirect|<nid>. We should scan the old database for these and fix any -- and confirm they include the broken post above.

@jywarren jywarren added bug the issue is regarding one of our programs which faces problems when a certain task is executed high-priority labels Sep 7, 2016
@jywarren
Copy link
Member Author

jywarren commented Sep 8, 2016

DrupalNode.where(path: 'DUPLICATE', status: 1) returns nothing.

@jywarren
Copy link
Member Author

jywarren commented Sep 8, 2016

However this returns 100 records:

redirects = DrupalNode.where('type LIKE (?)', 'redirect|%').limit(100)

so... there are a lot of them. 223, to be exact:

redirect|163,redirect|220,redirect|329,redirect|329,redirect|334,redirect|220,redirect|338,redirect|338,redirect|319,redirect|339,redirect|350,redirect|348,redirect|348,redirect|2,redirect|382,redirect|79,redirect|72,redirect|72,redirect|300,redirect|425,redirect|424,redirect|441,redirect|447,redirect|450,redirect|450,redirect|457,redirect|420,redirect|328,redirect|483,redirect|482,redirect|481,redirect|496,redirect|502,redirect|90,redirect|503,redirect|407,redirect|488,redirect|444,redirect|540,redirect|514,redirect|541,redirect|538,redirect|568,redirect|588,redirect|605,redirect|606,redirect|607,redirect|620,redirect|626,redirect|507,redirect|539,redirect|71,redirect|657,redirect|22,redirect|71,redirect|688,redirect|18,redirect|718,redirect|726,redirect|740,redirect|740,redirect|740,redirect|789,redirect|792,redirect|794,redirect|787,redirect|787,redirect|788,redirect|813,redirect|828,redirect|829,redirect|648,redirect|826,redirect|826,redirect|273,redirect|834,redirect|856,redirect|860,redirect|861,redirect|827,redirect|539,redirect|900,redirect|828,redirect|918,redirect|924,redirect|1458,redirect|1459,redirect|1460,redirect|1461,redirect|1462,redirect|1463,redirect|1464,redirect|1490,redirect|539,redirect|1584,redirect|1587,redirect|1592,redirect|508,redirect|1623,redirect|1748,redirect|1781,redirect|623,redirect|1848,redirect|1827,redirect|1877,redirect|3,redirect|1909,redirect|539,redirect|1911,redirect|1950,redirect|1989,redirect|2008,redirect|2009,redirect|2011,redirect|762,redirect|2120,redirect|539,redirect|2287,redirect|2220,redirect|2312,redirect|2338,redirect|2396,redirect|2422,redirect|2423,redirect|2424,redirect|539,redirect|2618,redirect|2626,redirect|539,redirect|539,redirect|539,redirect|2715,redirect|2257,redirect|2930,redirect|2962,redirect|2866,redirect|3004,redirect|3124,redirect|2626,redirect|1748,redirect|1490,redirect|3181,redirect|3231,redirect|90,redirect|69,redirect|407,redirect|3465,redirect|3547,redirect|220,redirect|245,redirect|1830,redirect|1830,redirect|1831,redirect|1909,redirect|3739,redirect|3766,redirect|3837,redirect|3909,redirect|4127,redirect|4369,redirect|616,redirect|4691,redirect|617,redirect|4835,redirect|4835,redirect|4835,redirect|4859,redirect|4865,redirect|4998,redirect|3768,redirect|5182,redirect|5215,redirect|5215,redirect|5215,redirect|3439,redirect|3680,redirect|3109,redirect|178,redirect|178,redirect|5425,redirect|5530,redirect|5663,redirect|5850,redirect|5978,redirect|5850,redirect|5987,redirect|6038,redirect|6038,redirect|6083,redirect|6108,redirect|6139,redirect|6175,redirect|6233,redirect|6287,redirect|5719,redirect|5719,redirect|6349,redirect|6379,redirect|6382,redirect|6425,redirect|5850,redirect|5850,redirect|6493,redirect|6525,redirect|6717,redirect|5609,redirect|657,redirect|785,redirect|6718,redirect|6956,redirect|3718,redirect|7193,redirect|7294,redirect|7341,redirect|7142,redirect|7266,redirect|7414,redirect|539,redirect|7903,redirect|8054,redirect|1789,redirect|1805,redirect|71

I put them here: https://publiclab.org/redirects.txt

@jywarren
Copy link
Member Author

jywarren commented Sep 8, 2016

They indeed include: "REDIRECT-notes/liz/8-3-2011/infrared-balloon-image-reveals-gowanus-plume-0.9933278192862228" but nothing by hunter (the second broken link).

@jywarren
Copy link
Member Author

jywarren commented Sep 9, 2016

I wonder if there's an issue with legacy users, since https://publiclab.org/profile/hunter also doesn't load. Maybe recent changes haven't accounted for unmigrated users. Maybe we should just auto-migrate all users who have content or comments.

@jywarren
Copy link
Member Author

jywarren commented Sep 9, 2016

We can run u.migrate unless u.using_new_site? for each unmigrated user (commenters and authors). All commenters/authors (migrated and not) listed here: https://gist.github.com/jywarren/9c2043a4b8f4c568f6925905fa562487

@jywarren
Copy link
Member Author

jywarren commented Sep 9, 2016

Doing that for Hunter fixed https://publiclab.org/notes/hunter/7-19-2012/irvs-timelapse. Great.

@jywarren
Copy link
Member Author

jywarren commented Sep 9, 2016

this is now done for all the prior listed uids.

@jywarren
Copy link
Member Author

jywarren commented Sep 9, 2016

Also, in #808 resolved #807, so that's probably not related to this.

@jywarren
Copy link
Member Author

jywarren commented Sep 9, 2016

Added a test for the redirection -- and noticed that many redirect records have a path field of nil. Looking in legacy db to recover these. Related to friendly_id migration.

@jywarren
Copy link
Member Author

jywarren commented Sep 9, 2016

Redirects with no path: [10715, 10716, 10717, 10718, 10719, 10720, 10721, 10724, 10725, 10726, 10727, 10729, 10731, 10734, 10735, 10738, 10740, 10741, 10743, 10744, 10745, 10747, 10748, 10749, 10750, 10751, 10752, 10753, 10754, 10755, 10756, 10757, 10759, 10760, 10761, 10762, 10764, 10766, 10767, 10769, 10770, 10771, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 10781, 10782, 10784, 10787, 10789, 10790, 10791, 10793, 10794, 10795, 10796, 10797, 10800, 10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 10811, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 10821, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 10831, 10832, 10833, 10834, 10835, 10836, 10837, 10838, 10839, 10840, 10841, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 10851, 10852, 10853, 10854, 10855, 10856, 10857, 10860, 10861, 10862, 10863, 10864, 10865, 10866, 10867, 10868, 10869, 10870, 10872, 10873, 10878, 10879, 10880, 10881, 10882, 10883, 10885, 10886, 10887, 10889, 10890, 10891, 10892, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 10902, 10903, 10904, 10905, 10906, 10907, 10908, 10909, 10911, 10912, 10913, 10914, 10915, 10917, 10918, 10919, 10920, 10921, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 10931, 10932, 10933, 10934, 10935, 10936, 10937]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed
Projects
None yet
Development

No branches or pull requests

1 participant