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

Unable to open admin panel after upgrade to 1.1.0 #699

Closed
bim9262 opened this issue Jul 15, 2016 · 22 comments
Closed

Unable to open admin panel after upgrade to 1.1.0 #699

bim9262 opened this issue Jul 15, 2016 · 22 comments

Comments

@bim9262
Copy link

bim9262 commented Jul 15, 2016

"An exception has been thrown during the rendering of a template ("file_exists(): open_basedir restriction in effect. File(/srv/httpuser/plugins/admin/themes/grav/css-compiled/nucleus.css) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/bin)") in "partials/base.html.twig" at line 21."

Not sure why it is trying to go to /srv/httpuser, everything is in /srv/http. Is there a base folder configuration somewhere?

@rhukster
Copy link
Member

There's probably a missing / so it's trying to get to /srv/http/user/plugin/admin/themes/....

I'm not really able to recreate this situation though as my theme_url is correct, but i'm guessing yours is not..

@rhukster
Copy link
Member

what does your source for css/js look like? mine is like this:

<link href="/user/plugins/admin/themes/grav/css-compiled/nucleus.css?f4f2bfe154" type="text/css" rel="stylesheet" />
<link href="/user/plugins/admin/themes/grav/css-compiled/template.css?f4f2bfe154" type="text/css" rel="stylesheet" />
<link href="/user/plugins/admin/themes/grav/css-compiled/preset.css?f4f2bfe154" type="text/css" rel="stylesheet" />
<link href="/user/plugins/admin/themes/grav/css-compiled/fonts.css?f4f2bfe154" type="text/css" rel="stylesheet" />
<link href="/user/plugins/admin/themes/grav/css/font-awesome.min.css?f4f2bfe154" type="text/css" rel="stylesheet" />
<link href="/user/plugins/admin/themes/grav/css/chartist.min.css?f4f2bfe154" type="text/css" rel="stylesheet" />
<link href="/user/plugins/admin/themes/grav/css/selectize.min.css?f4f2bfe154" type="text/css" rel="stylesheet" />
<link href="/user/plugins/admin/themes/grav/css/hint.base.min.css?f4f2bfe154" type="text/css" rel="stylesheet" />

and:

<script src="/system/assets/jquery/jquery-2.x.min.js?f4f2bfe154" type="text/javascript" ></script>
<script src="/user/plugins/admin/themes/grav/js/vendor.min.js?f4f2bfe154" type="text/javascript" defer></script>
<script src="/user/plugins/admin/themes/grav/js/admin.min.js?f4f2bfe154" type="text/javascript" defer></script>

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

I have

$twig->twig_vars['theme_url'] = $this->grav['locator']->findResource('plugin://admin/themes/' . $this->theme, false);

I cannot tell what the source for css/js look like because it won't compile the twig file...

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

btw I currently have Admin plugin v1.0.10. Dose the plugin version need to match the Grav version?

@w00fz
Copy link
Member

w00fz commented Jul 15, 2016

Grav and Admin versions are usually the same when there's a major release, otherwise most of the time they go their own way.

You definitely want to update Admin to v1.1.1 that was released today.

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

I get the same error after upgrading. Here is the list of packages that I have yet to upgrade.

$ ./bin/gpm update

GPM Releases Configuration: Stable

Found 8 extensions installed of which 6 need updating

01. Problems        [v1.4.2 ➜ v1.4.3]
02. Email           [v2.4.0 ➜ v2.4.1]
03. Login           [v1.3.1 ➜ v2.0.0]
04. Form            [v1.2.2 ➜ v1.3.0]
05. Error           [v1.4.1 ➜ v1.5.0]
06. Antimatter      [v1.8.0 ➜ v2.0.0]

I have Admin Panel [ admin ] [v1.1.0] (installed)

@flaviocopes
Copy link
Contributor

Strange. Can you do a "View Page Source" and search for css-compiled/nucleus.css? Can you paste that line?

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

<span>An exception has been thrown during the rendering of a template (&quot;file_exists(): open_basedir restriction in effect. File(/srv/httpuser/plugins/admin/themes/grav/css-compiled/nucleus.css) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/bin)&quot;) in &quot;partials/stylesheets.html.twig&quot; at line 1.</span>
<span id="plain-exception">Twig_Error_Runtime thrown with message &quot;An exception has been thrown during the rendering of a template (&quot;file_exists(): open_basedir restriction in effect. File(/srv/httpuser/plugins/admin/themes/grav/css-compiled/nucleus.css) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/bin)&quot;) in &quot;partials/stylesheets.html.twig&quot; at line 1.&quot;

Stacktrace:
#35 Twig_Error_Runtime in /srv/http/vendor/twig/twig/lib/Twig/Template.php:402
#34 Whoops\Exception\ErrorException in /srv/http/system/src/Grav/Common/Assets.php:1132
#33 file_exists in /srv/http/system/src/Grav/Common/Assets.php:1132
#32 Grav\Common\Assets:getLastModificationTime in /srv/http/system/src/Grav/Common/Assets.php:286
#31 Grav\Common\Assets:addCss in /srv/http/vendor/twig/twig/lib/Twig/Template.php:604
#30 Twig_Template:getAttribute in /srv/http/cache/twig/aa/aac8c9882260dcf243f22049e9807efb5208c0074d76515b6a3f2533599d231d.php:19
#29 __TwigTemplate_07d069570c0031d27275a5b1dc5327281227e323d260352893e8d2a2aeac6652:doDisplay in /srv/http/vendor/twig/twig/lib/Twig/Template.php:387
#28 Twig_Template:displayWithErrorHandling in /srv/http/vendor/twig/twig/lib/Twig/Template.php:355
#27 Twig_Template:display in /srv/http/cache/twig/9c/9c4c16b8a36a02ca3e2ece07b7ae07f7723d2c91c20528e85001fa92bafc7d58.php:120
#26 __TwigTemplate_2841f6935d026834904ae5d765f446a9b69db82795b119f3c54782a35fdf962e:block_stylesheets in /srv/http/vendor/twig/twig/lib/Twig/Template.php:167
#25 Twig_Template:displayBlock in /srv/http/cache/twig/9c/9c4c16b8a36a02ca3e2ece07b7ae07f7723d2c91c20528e85001fa92bafc7d58.php:104
#24 __TwigTemplate_2841f6935d026834904ae5d765f446a9b69db82795b119f3c54782a35fdf962e:block_head in /srv/http/vendor/twig/twig/lib/Twig/Template.php:167
#23 Twig_Template:displayBlock in /srv/http/cache/twig/9c/9c4c16b8a36a02ca3e2ece07b7ae07f7723d2c91c20528e85001fa92bafc7d58.php:36
#22 __TwigTemplate_2841f6935d026834904ae5d765f446a9b69db82795b119f3c54782a35fdf962e:doDisplay in /srv/http/vendor/twig/twig/lib/Twig/Template.php:387
#21 Twig_Template:displayWithErrorHandling in /srv/http/vendor/twig/twig/lib/Twig/Template.php:355
#20 Twig_Template:display in /srv/http/cache/twig/02/02e7dcfb2364dac5580a00baaeb185e57ec419a34384263ffab65fe6a54053b7.php:29
#19 __TwigTemplate_17ab5c793c5fd9088fe2c7c857bdfd0cdf41b4b253defcd2e7c8b78a7c703000:doDisplay in /srv/http/vendor/twig/twig/lib/Twig/Template.php:387
#18 Twig_Template:displayWithErrorHandling in /srv/http/vendor/twig/twig/lib/Twig/Template.php:355
#17 Twig_Template:display in /srv/http/cache/twig/67/677373c8304a822fc271d37f52d88c5bde8bc4a157c56187072ad4833ae34995.php:59
#16 __TwigTemplate_cc556578516106fd8312b3287682cb95acac1e1ac324818ebcb00c33d7cc512c_38245039:doDisplay in /srv/http/vendor/twig/twig/lib/Twig/Template.php:387
#15 Twig_Template:displayWithErrorHandling in /srv/http/vendor/twig/twig/lib/Twig/Template.php:355
#14 Twig_Template:display in /srv/http/cache/twig/67/677373c8304a822fc271d37f52d88c5bde8bc4a157c56187072ad4833ae34995.php:19
#13 __TwigTemplate_cc556578516106fd8312b3287682cb95acac1e1ac324818ebcb00c33d7cc512c:doDisplay in /srv/http/vendor/twig/twig/lib/Twig/Template.php:387
#12 Twig_Template:displayWithErrorHandling in /srv/http/vendor/twig/twig/lib/Twig/Template.php:355
#11 Twig_Template:display in /srv/http/vendor/twig/twig/lib/Twig/Template.php:366
#10 Twig_Template:render in /srv/http/vendor/twig/twig/lib/Twig/Environment.php:347
#9 Twig_Environment:render in /srv/http/system/src/Grav/Common/Twig/Twig.php:340
#8 Grav\Common\Twig\Twig:processSite in /srv/http/system/src/Grav/Common/Service/OutputServiceProvider.php:19
#7 Grav\Common\Service\OutputServiceProvider:Grav\Common\Service\{closure} in /srv/http/vendor/pimple/pimple/src/Pimple/Container.php:113
#6 Pimple\Container:offsetGet in /srv/http/system/src/Grav/Common/Processors/RenderProcessor.php:17
#5 Grav\Common\Processors\RenderProcessor:process in /srv/http/system/src/Grav/Common/Grav.php:121
#4 Grav\Common\Grav:Grav\Common\{closure} in /srv/http/system/src/Grav/Common/Grav.php:383
#3 Grav\Common\Grav:Grav\Common\{closure} in /srv/http/system/src/Grav/Common/Grav.php:359
#2 call_user_func_array in /srv/http/system/src/Grav/Common/Grav.php:359
#1 Grav\Common\Grav:__call in /srv/http/system/src/Grav/Common/Grav.php:122
#0 Grav\Common\Grav:process in /srv/http/index.php:45
</span>
<div class="code-block frame-args prettyprint">
              <ol class="linenums"><li><pre class=sf-dump id=sf-dump-1599183066 data-indent-pad="  ">"<span class=sf-dump-str title="64 characters">/srv/httpuser/plugins/admin/themes/grav/css-compiled/nucleus.css</span>"
</pre><script>Sfdump("sf-dump-1599183066")</script>
</li></ol>          </div>
<div class="code-block frame-args prettyprint">
              <ol class="linenums"><li><pre class=sf-dump id=sf-dump-1044627094 data-indent-pad="  ">"<span class=sf-dump-str title="55 characters">user/plugins/admin/themes/grav/css-compiled/nucleus.css</span>"
</pre><script>Sfdump("sf-dump-1044627094")</script>
</li></ol>          </div>
 // line 1
        $this-&gt;getAttribute((isset($context[&quot;assets&quot;]) ? $context[&quot;assets&quot;] : null), &quot;addCss&quot;, array(0 =&gt; ((isset($context[&quot;theme_url&quot;]) ? $context[&quot;theme_url&quot;] : null) . &quot;/css-compiled/nucleus.css&quot;)), &quot;method&quot;);

@flaviocopes
Copy link
Contributor

Your site root folder is /srv/httpuser?

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

No, as @rhukster pointed out the / is missing between the http and user directories so something like /srv/http/user/plugin/admin/themes/is coming up as /srv/httpuser/plugin/admin/themes/

My site root is /srv/http

@rhukster
Copy link
Member

Maybe we can get a zip of your site to try locally? Also what webserver are you running, if it's not apache, what does your vhost config look like?

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

You can grab a zip of my site here.
I am running nginx. I've not had any problems to date with this config:

# HTTPS server
    #
    server {
        listen       443 ssl;
        server_name  bmalyn.com;

        include ssl.conf;

        root   /srv/http;

        location / {
            index  index.php;
            try_files $uri $uri/ /index.php?$uri;
        }
    }

@rhukster
Copy link
Member

Ok, after updating all the plugins, your zip works fine on my local with apache. I think this is an nginx config issue specifically.

can you try this:

location / {
        try_files $uri $uri/ /index.php?_url=$uri;
    }

@rhukster
Copy link
Member

I don't think it's that honestly, but I need to get an nginx setup local to test more.

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

That didn't change anything. I updated all of the plugins and then cleared the cache. I still get the same error. See here.

@maxnegro
Copy link

I have the same problem and symptoms (missing / in path before user), arisen after upgrading grav and admin to 1.1.1. Tried deleting and reinstalling admin, no benefit. Web server is apache.

@rhukster
Copy link
Member

Hmm.. maybe it's not nginx then. It works fine for me on Nginx too. Something else weird is going on. Do you both have open_basedir restrictions enabled?

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

An exception has been thrown during the rendering of a template ("file_exists(): open_basedir restriction in effect. File(/srv/httpuser/plugins/admin/themes/grav/css-compiled/nucleus.css) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/bin)") in "partials/stylesheets.html.twig" at line 1.

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

To be fair grav is trying to reach a forbidden location (also one that doesn't exist)

@rhukster
Copy link
Member

Can you please try with flavios latest commit. Should fix it

d233220

@bim9262
Copy link
Author

bim9262 commented Jul 15, 2016

That fixed it. Thanks.

@bim9262 bim9262 closed this as completed Jul 15, 2016
@happywebio
Copy link

I had the exact same issue while upgrading Grav today. That fixed it, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants