Webform not accessible for guest user on Production mode only, throws 403 error

I have a doctype(Early Invite) & a webform for that doctype created & publish,

In Development mode: when I try to open the webform page(localhost:8003/early-invite) the page opens fine
In Production mode: when I try to open the webform page(localhost:8003/early-invite) the page throws a 403 error and displays: ‘Not permitted’ with the ‘Login’ button

notes:
In development mode: I’ve given permission to ‘Early Invite’ doctype only to the system user and it works fine
In Production mode: I’ve tried giving all(CRUD) access to the Guest in ‘Early Invite’ doctype but I’m still seeing that 403 forbidden issue

what else should I do?

any inputs, please

Update:
Development mode: is tested in my local machine
Production mode: i take the backup of the site from my local machine and restore the site in the production machine/EC2.
not sure if this workflow would have any impact?

Stupid question but is [Login Required] checked on the Webform?

it is not checked.

the weird thing is it works in staging but not in production,

but one thing I missed to update(now updated in the question as well, please check if site restore might affect in any way?)

We know that in development mode users and roles can be impersonated.

We also know that Guest is a second class citizen.

I am sure you have already checked this but on the dev box does Guest have a role. That would elevate it privileges.

sorry, are you asking me to check the ‘Permission Rules’ for ‘Early Invite’ doctype?

What happens when you take your Dev box out of developer mode? Can you recreate the error on the dev Box ?

yes, seeing the issue going into production mode

Ok now that it is occurring in both places you can debug it. Is there a stack trace that accompanies the error?

I don’t see any logs getting generated for 403 forbidden error, which log file it’d be generated?

This issue has already been fixed in develop branch fix(web form): Directly pass `link_title_doctypes` instead of calling for it by surajshetty3416 · Pull Request #16631 · frappe/frappe · GitHub

Edit: This issue occurs only on develop branch so this fix won’t work unless your production site is not on develop branch of frappe.

1 Like

that was the issue.
once I pointed frappe to the dev branch, it works, thanks @shadrak98