eZ Community » Forums » eZ Publish 5 Platform » User does not have access to 'read'...
expandshrink

User does not have access to 'read' 'content'

User does not have access to 'read' 'content'

Thursday 25 April 2013 5:55:33 pm - 23 replies

Hi all,

I created a new section and affected it to a node.

In my website, when I'm not connected, if I try to see this page, Symfony throws an exception :

User does not have access to 'read' 'content'

500 Internal Server Error - UnauthorizedException

Surprising. I think this exception should be caught by default to display a login form. This works if I set legacy_mode to true for my siteaccess. I would prefer not to do this.

How can I catch this exception to display my login form or register form ? What is the best practice in eZ 5 ?

Friday 26 April 2013 9:52:56 am

Shooting from the hip here ' I have the impression that Sf throws a lot of exceptions in DEV mode which hare handled nicely when in PROD mode.

I do not yet understand the principle fully, as to me it makes sense to be able to debug access-denied pages even when in dev mode - but then I have a lot of Sf learning to do, still...

Friday 26 April 2013 10:28:36 am

Gaetano, you're right. I just tried my problem in "prod mode". The exception is still displayed, but seems to be caught by twig :

TwigBundle:Exception:error500.html.twig

Friday 26 April 2013 4:38:55 pm

Anyone ? Because I still don't know how to override my "user/login" or "user/register" with eZ 5.

Friday 26 April 2013 6:06:14 pm

Hi Nicolas

I think this can help you : http://symfony.com/doc/current/cookbook/controller/error_pages.html

blunk.gif Emoticon

Quote from Gaetano Giunta :

Shooting from the hip here ' I have the impression that Sf throws a lot of exceptions in DEV mode which hare handled nicely when in PROD mode.

Of course ! In dev, you need all the stack trace and everything, while un prod you need to be as light as possible (and defer to log files). Symfony throws exceptions when there is a need for it, in dev or prod... What change is the way the are displayed.

Anyway Nicolas, I think you should report an issue because this should be handled natively by eZ Publish happy.gif Emoticon.

Friday 26 April 2013 6:18:26 pm

Jérôme,

 

Thanks for the link.

Anyway Nicolas, I think you should report an issue because this should be handled natively by eZ Publish

Oh, ok, I understand now!

Friday 26 April 2013 6:23:48 pm

This is now on your side ! https://jira.ez.no/browse/EZP-20782

Friday 26 April 2013 7:00:27 pm

Thank Nicolas

Next step do a pull-request happy.gif Emoticon

Thursday 16 May 2013 10:16:00 pm

@Gaetano. +1 to your comment. Actually, in dev mode, i get an exception if trying to load an image, the file doesn't exist on disk. This prevents me to load anything of the page. 

Is there anyway to maybe change this to a warning or something like that?

Friday 17 May 2013 8:42:24 am

Quote from Carlos Revillo :

@Gaetano. +1 to your comment. Actually, in dev mode, i get an exception if trying to load an image, the file doesn't exist on disk. This prevents me to load anything of the page.

Is there anyway to maybe change this to a warning or something like that?

 Carlos, I have the same problem. I tought it was a configuration problem on my server.

Thursday 18 July 2013 9:13:36 am

Quote from Nicolas Lescure :
Quote from Carlos Revillo :

@Gaetano. +1 to your comment. Actually, in dev mode, i get an exception if trying to load an image, the file doesn't exist on disk. This prevents me to load anything of the page.

Is there anyway to maybe change this to a warning or something like that?

 Carlos, I have the same problem. I tought it was a configuration problem on my server.

Which  configuration problem ? 

Thursday 18 July 2013 4:36:00 pm

@carlos @nicolas the workaround for now is to register a new ezimage class (or just the IO adapter, not 100%sure).

I forwarded this request to eZ engineering, but there is some opposition to "allowing broken data in the new content model", even though this is a common usecase (shared dev environments, import situations etc).

I think you should open a fetaure request in Jira so that it gets tracked over time and possibly fixed

Friday 19 July 2013 9:20:21 am

Gaetano, I understand why an exception is thrown. The real problem is the way it is caught or not. A 404 on an image can't generate a "500 error" on the page. 

Let's go for the issue.

Friday 19 July 2013 9:29:07 am

Totally agree with Nicolas here. One of the things i needed to start the migration of one of my sites to symfony stack was to download everything from the var production folder. 

At least there should be a way to let you develop without the need of having everything in your dev server. 

Friday 19 July 2013 9:39:38 am

Issue created here : https://jira.ez.no/browse/EZP-21297

Feel free to comment or to explain better than me happy.gif Emoticon

Friday 19 July 2013 10:40:57 am

Thanks for the report Nicolas.

We'll probably take care of it next sprint happy.gif Emoticon.

What will probably happen is an implementation of a workaround since we definitely don't want corrupted states in production. However this definitely makes sense in dev (so debug mode).

Friday 19 July 2013 11:15:03 am

Quote from Jérôme Vieilledent :

What will probably happen is an implementation of a workaround since we definitely don't want corrupted states in production. However this definitely makes sense in dev (so debug mode).

Jérôme, this is much more than a developper issue. I can imagine many cases in production :

  • a down nfs mount 
  • wrong permission problems on an image
  • file removed from server

Any of this problem create a full 500 error page. For users or Google bots it is a big problem.

Modified on Friday 19 July 2013 11:15:53 am by Nicolas Lescure

Friday 19 July 2013 11:37:36 am

We're gonna make it simple, Nicolas: I globally agree with you. The jira issue has been set to confirmed, and I think I'll take the problem over during the next sprint.

I intend to make the Legacy IO handler aware of this, and set it to log such errors. It bothers me a bit in terms of data safety, but yes, it is too strict.

Friday 19 July 2013 11:54:35 am

I have a question. Does it crash if you rename one of your css?

Friday 19 July 2013 12:04:46 pm

Quote from Bertrand Dunogier :

The jira issue has been set to confirmed, and I think I'll take the problem over during the next sprint.

Thank you. I will test your patch.

Friday 19 July 2013 12:15:31 pm

About CSS, I don't  think so, Carlos. It only affects clustered content.

One note, Nicolas: I still think we should encourage sane repositories, with content where it should be, so that when an error occurs, it is actually meaningful. We will just make sure we give an option to be lax and accept errors willingfully.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from