Plugins' web assets not published to web directory

Bug #662204 reported by Robin Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AuthPuppy
Status tracked in Trunk
Trunk
Fix Released
High
gbastien

Bug Description

Google Map not shown on servers where website is not in root, because the path for apNodeExtraPlugin/js/hotspots_map_google.js is wrong...

debug below:
    <title>NetworkFusion Hotspots</title>
    <link rel="shortcut icon" href="/favicon.ico" />
        <link rel="stylesheet" type="text/css" media="screen" href="/authpuppy/web/apNodeExtraPlugin/css/map.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/authpuppy/web/css/blueprint/screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="/authpuppy/web/css/blueprint/print.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/authpuppy/web/css/main.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/authpuppy/web/css/jQuery/themes/ui-lightness/jquery-ui-1.8.2.custom.css" />
            <script type="text/javascript" src="/authpuppy/web/apNodeExtraPlugin/js/hotspots_map_google.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="/authpuppy/web/js/authpuppy.js"></script>
<script type="text/javascript" src="/authpuppy/web/js/jQuery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/authpuppy/web/js/jQuery/jquery-ui-1.8.2.custom.min.js"></script>
    </head>
    <body>

    <div id="page" class="container ">

Revision history for this message
Frédéric Sheedy (fsheedy) wrote :

I am not able to reproduce this bug.
Link seem to be ok.
Do you have any Javascript error?

Changed in authpuppy:
status: New → Incomplete
Revision history for this message
Robin Jones (robin-networkfusion) wrote :

Yes, there are 2...

the first one is that hotspots_map_google.js is not found, and the second is that unknown variable GoogleHotspotMap (obviously because it cannot find the class).

I am runing this on a windows server, so it might be caused by the route to the directory.

typing in http://<auth server>/apNodeExtraPlugin/js/hotspots_map_google.js, returns a 404 error. where as if I do the same to http://demo.authpuppy.org/apNodeExtraPlugin/js/hotspots_map_google.js it downloads the file.

Changed in authpuppy:
assignee: nobody → Frédéric Sheedy (fsheedy)
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
Frédéric Sheedy (fsheedy) wrote :

Still not able to reproduce the bug on Linux.
Link for hotspots_map_google.js file is not hard coded but use addJavascript symfony function.

Changed in authpuppy:
status: Triaged → Incomplete
Revision history for this message
gbastien (gbastien02) wrote :

Any update on that? Robin, are you using the latest apNodeExtraPlugin?

If so and it still doesn't work, could you provide a link to your windows install so we can check this out? Or see if there are logs on your server?

Also make sure the directory web/apNodeExtraPlugin exists. When installing a plugin via the authpuppy interface a symlink is created in the web directory to the plugin web assets. Maybe that step pose problem on a Windows server...

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

Hi Geneviève,

I am on holiday at the moment and my internet is limited to say the least... It is still a problem, but so are a couple of other things at the moment, since I updated the core to the commit before the css in IE6 was fixed (although it seems to have disappeared from the trunk!!!)

I will email you with the link to my server (probably next friday) and any other information I think you may need...

Robin.

Revision history for this message
Frédéric Sheedy (fsheedy) wrote :

Any news? This bug will be soon out-of-date.

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

still waiting for Geneviève to reply to the email?!?

If he didn't get it, what email should I send it to?

Revision history for this message
gbastien (gbastien02) wrote :

I didn't get any email? Or it got lost somewhere in my mailbox...
Send it to <email address hidden>

Revision history for this message
gbastien (gbastien02) wrote :

It seems the css and js files from the apNodeExtraPlugin are not available on your server, though the url is ok as far as the non-root is concerned.

How did you install the plugin? manual or automatic install?

If automatic, is your /web/ directory writeable (the plugin's assets are copied there)? And are the files /web/apNodeExtraPlugin/* present? It may be a windows copy file problem...

If manual, you have to manually copy the plugin's web files to the applications /web directory (see http://www.authpuppy.org/doc/Managing_Plugins#Manual_install)

If you did all this correctly... maybe check the permissions on the directory?

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

The plugins were installed through the interface (allthough it was frontend_dev, due to the server 500 error) and all the directories that should be writable, are... (see attached)

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

> Have you cleared cache? Does the clear cache function not work well on a Windows server? It is run every time a plugin is installed or updated and should remove all files from the cache/ directory.

I am unsure whether symfony cacheing is available on this windows shared hosting account, is there any way to check? if not, wouldn't it only cause the app to run slower?

I will see if I can find some time to build a windows server VM so that I can test it in a more controlled environment...

Revision history for this message
gbastien (gbastien02) wrote :

I'll check for the plugin's web assets to make sure everything works fine. I'll let you know if it is supposed to work...

As for caching, check out the apps/frontend/config/settings.yml, the dev environment has a no-cache setting, so try disabling it on the prod site too

gbastien (gbastien02)
summary: - Google Map not shown on servers where website is not in root
+ Plugins' web assets not published to web directory
Changed in authpuppy:
status: Incomplete → Confirmed
milestone: none → 0.1.1-alpha
Revision history for this message
gbastien (gbastien02) wrote :

Committed a possible patch for this. Could you reinstall the apNodeExtraPlugin from the interface and see if it now works?

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

ok, upgrading the main authpuppy app first... it may take a while before I will get to the point where I can install the plugins! Damn FTP!

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

Ok, first of all, I am now receiving the following errors on install:

Warning: touch() [function.touch]: Unable to create file D:\Hosting\5923242\html../config/authpuppy.yml because No such file or directory in D:\Hosting\5923242\html\authpuppy\web\preinstall.php on line 180
 /config/authpuppy.yml

* Must be writeable to enable/disable plugins and keep some system-wide information

Warning: copy(D:\Hosting\5923242\html../config/databases.yml.default) [function.copy]: failed to open stream: No such file or directory in D:\Hosting\5923242\html\authpuppy\web\preinstall.php on line 183

I thought these were fixed in an earlier build?

I will go ahead and do it manually though...

Revision history for this message
gbastien (gbastien02) wrote :

You're facing this bug https://bugs.launchpad.net/authpuppy/+bug/711931 that should soon be corrected.

In the meantime, you should upload an empty installed.txt file in the web directory and manually put the databases.yml and authpuppy.yml

But wait a minute, is your web/ directory called html? and the apps/ config/ etc. directory are in html/..? If so, I'm afraid there is still a bug that should be corrected soon ;-)

Revision history for this message
gbastien (gbastien02) wrote :

Ok so whether that last part was a problem or not, it is not anymore.

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

OK, the original fault of the hotspotmap not showing now seems to be working correctly, with the js and css adding it's self correctly to the web dir!

There are still some other errors though if you want to take a look?

I have set you up as an admin with the same username and password I sent you.

the 3 of note are:

* when logging onto the server through Administrative Signin, you are prompted to enter a username and password like the directory is protected, although clicking cancel allows you to carry on.

* aplocaluserplugin doesnt seem to install correctly, and when enabled, throws symfony errors

* error 500 is thrown when you try to install a plugin, but when doing it through frontend_dev the error is still thrown, but the plugin installed.

I have also turned caching off for the production interface, which has seemed to have stopped it throwing so many 500 errors!

Revision history for this message
gbastien (gbastien02) wrote :

Ok so problems in order...

1- When clicking administrative signin, it actually leads to a page that returns a 401 and then redirects to the login page. So I guess your server is set to prompt for username/password on 401. I'm not sure how to solve that... I'll ask Philippe for some advice. Unless you know... Could it be in the web.config file?

2- What do you mean doesn't install correctly? I've been able to create an account from the admin interface and login without apparent errors. But it should be impossible to click on the link to configure the plugin if the plugin is not enabled, that causes errors.

3- Yes yes the caching, haven't thought of that but every plugin installl or plugin enable request clears the cache, but if the server has cache disabled because it caused errors, then I guess trying to clear it will cause errors too! So we shouldn't do that if cache is not enabled at all on the server...

But why doesn't the caching work? Do you have access to any logs? Or maybe try to enable caching on dev so you can see what the errors with frontend_dev.php. Or if you allow me, I could play around with your server.

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

1 I think this artical might be useful... http://www.codeproject.com/KB/aspnet/Custon401Page.aspx

2 OK, that is quite strange why it has started working... I will flag it again if it reoccurs!

3 good Idea... you are more than welcome to play with my server, the more is solved, the better it will be for the community. and this server is only a test system. If you need anything doing that you dont have access to, just let me know.

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

I have enabled detailed errors for remote connections in the web config file.

I have also enabled cacheing in the debug environment.

I think the error with installing plugins is the fact that there are colons in the url, which is not allowed as the webserver thinks it preceeds a port number. http://stackoverflow.com/questions/3457643/iis7-url-redirect-not-working-for-aspx-pages-with-colons-in-the-name

Revision history for this message
gbastien (gbastien02) wrote :

Ok, changed the : to _ and now seems to work.

As for the caching problem, I don't get much error, what I see is not a symfony 500 but a windows 500 "The FastCGI process exceeded configured activity timeout". Is that what you had? Do you have any control on that variable?

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

ok, I added:

        <fastCgi>
            <application fullPath="C:\php5\php-cgi.exe" activityTimeout="600">
                <environmentVariables>
                </environmentVariables>
            </application>
        </fastCgi>

to web.config and that problem is fixed :-)

this would be dependedent on the web environment though, as obviously the PHP variable would be dependent on the users install.

I will turn caching back on for the production environment as you said, that seems to be working fine...

so last thing is the 401 problem, but I am happy to open a seperate bug report for that!?

Revision history for this message
gbastien (gbastien02) wrote :

Thanks, will add that to the web.config

And from your experience, is there anything worth documenting explicitly to work with Windows server on the AuthPuppy wiki? Maybe we could add a Windows section to the install documentation on www.authpuppy.org/doc/Getting_Started

Revision history for this message
gbastien (gbastien02) wrote :

By the way, does that go inside the <configuration></configuration> tags? Or at the root of the file?

Revision history for this message
gbastien (gbastien02) wrote :

About the 401 problem... From this symfony bug http://trac.symfony-project.org/ticket/4474 and reading the http standard definition of the 401 status http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

I think we can safely remove the lines returning the 401 status as anyway it is a bad use of this status. That will solve your problem as well as some browser-specific problems we may get in the future.

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

> By the way, does that go inside the <configuration></configuration> tags? Or at the root of the file?

this is the top of my web.config file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <!-- Comment out Below to turn off detailed server errors -->
        <httpErrors errorMode="Detailed"/>
        <!-- Change the below settings to match your environment -->
        <fastCgi>
            <application fullPath="C:\php5\php-cgi.exe" activityTimeout="1200">
                <environmentVariables>
                </environmentVariables>
            </application>
        </fastCgi>

  <rewrite>
...

> About the 401 problem...

cool!

Revision history for this message
gbastien (gbastien02) wrote :

Ok changes done! Shall we close this bug?

Revision history for this message
Robin Jones (robin-networkfusion) wrote :

I spoke to soon on the "The FastCGI process exceeded configured activity timeout" problem, but I am sure that it is a problem with a setting on the server and not a problem with the program... I will get in touch with the hosts support dept. and see if they have any advice.

I have found this document which is quite good, although I only found it yesterday! http://www.symfony-project.org/more-with-symfony/1_4/en/11-Windows-and-Symfony

I will start something on the wiki for Windows and IIS, and will add remarks about shared hosting.

Yes, I think it is a good Idea to close this bug it has definitly solved a lot more problems than its title!

Revision history for this message
gbastien (gbastien02) wrote :

In 0.1.1-alpha

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.