Try ERPNext Buy Support Partners Foundation

Item website not visible when user is not logged in

Dear colleagues,

we observe a strange issue in one instance: when items are set to “show on website”, the route is generated. As long as one is logged in, also the Website can be displayed without any issues.

However, when the exact same page is accessed without being logged in, the error 404 (not permission error) is shown:
image
The items should also be displayed to not-logged-in users.

The system has been updated from v10 and is currently on v12.1. We have checked settings but did not find anything preventing unauthenticated access. If the same server is reset and a fresh database is loaded, items are displayed without any issues also without login.

Does anyone have any idea what could be the issue? Thanks for pointers/ideas!

My guess is a cache issue.
Is there any sort of proxy on the network that may be feeding/serving outdated versions

Hi @trentmu,
thanks for your input.
There is no proxy (it actually reproduces also when running a local VirtualBox image with this database). I have tried to rule out Cache issues by hitting F5/browser refresh. Also, when running it from a completely different computer, without login it will show 404…

I have seen this issue before. Was never able to resolve it. One guess is that there is some static site being generated and that job didn’t complete it.

Not to ask too stupid a question :blush:, since I’m 100% sure that you DO know what you’re doing…does bench clear-cache do anything useful

Hi @trentmu,

thanks for your input, I had not checked $ bench clear-cache. Unfortunately, it has no affect on the issue.

I have also followed the logic in [ERROR] Products page "missing or moved" to no success. Seems like this happens otherwise.

As I can set up a fresh system which behaves normally (products visible without login) I am ruling out a bug per se and try to find the configuration glitch…

I have looked through the Website Generator for Item but could not find an access restriction (or hint to configuration)…

Again, thanks to you both for your support!

Here a picture showing the issue (left with login, right in private mode/no login):

What sayeth the nginx (& other I guess) log files?

Interstingly, it reports all good - 200 (because actually a page is shown, which is the ERPNext 404-handling page):

12.234.56.123 - - [19/May/2020:12:27:19 +0000] "POST / HTTP/1.1" 200 17 "https://my.erpnext.com/produkte/vx3lb" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0" "-"

error.log is empty.

I can only hazard yet another guess that either the user, or role permissions are not set for default (non-logged-in) user(s)

Thanks for your input. I also considered permissions, but had only checked access to Item, which was the same as with the working system… I’ll look into this once again…

Have you checked the box, is a sales item? Just thinking of done settings that might help.

Yepp, it is a saleable item (also works well as soon as you are logged in)… But thanks for the input.

Hi @lasalesi, I guess we are having same issue and looking at it from different perspectives.

The reason why this is happening to you is because the route is not being generate probably because you update the tabItem table field “show_in_website” to 1… yeah?

The route is only being generated when you toggle it per item and click save.

Item show in website

HI @eagoweb,

thanks for your feedback. However, the show_in_website is set from the form and the route is created correctly. As long as the user is logged in, it does actually work; the only issue is if no user is logged in, the exact same URL will give the “404” response…