Wierd HTML behaviour with pagination?

5 views
Skip to first unread message

Jim Steil

unread,
Jun 20, 2008, 10:30:50 AM6/20/08
to turbo...@googlegroups.com
I don't even know how to describe the problem I'm having.  So, I'll give a little background

I'm using TG 1.0.4.4 on both my production and development machines. 

Development is Windows XP
Production is Windows 2003

I have run tg-admin info on both machines and am showing the exact same versions of everything except for setuptools, 0.6c7 on dvlp and 0.6.c8 on production. 

I use SVN for source control and it tells me that the source on both machines are the same (excluding .cfg files which need to be different).

The problem only happens in production and does not appear in my test environment.

THE PROBLEM

My app displays a list of contacts using the pageinatedatagrid widget.  From this list you can click on a contact to edit the details.  If you click on someone in the list on the first page, everything works fine.  However, if I click to a different page in the list, and then click on a contact to edit, the HTML comes up 'funny'.

Here is a screen shot of the way it's supposed to be (my apologies to those not viewing with HTML):



...and here is what it looks like when you have the problem:


It's like the widgets are getting chopped off or something.  Not sure if my comments about the pagination are a red herring or whether it is really the cause.  The problem appears on the page AFTER the datagrid page with the pagination.  Also, the 'problem' display is not always like that.  Sometimes it displays the submit button with the text 'Save'.  I'm really confused and don't know where to look. 

Any advice?

    -Jim

Lukasz Szybalski

unread,
Jun 20, 2008, 10:41:03 AM6/20/08
to turbo...@googlegroups.com
On Fri, Jun 20, 2008 at 9:30 AM, Jim Steil <st...@mailbag.com> wrote:
> I don't even know how to describe the problem I'm having. So, I'll give a
> little background
>
> I'm using TG 1.0.4.4 on both my production and development machines.
>
> Development is Windows XP
> Production is Windows 2003
>
> I have run tg-admin info on both machines and am showing the exact same
> versions of everything except for setuptools, 0.6c7 on dvlp and 0.6.c8 on
> production.
>
> I use SVN for source control and it tells me that the source on both
> machines are the same (excluding .cfg files which need to be different).
>
> The problem only happens in production and does not appear in my test
> environment.
>
> THE PROBLEM
>
> My app displays a list of contacts using the pageinatedatagrid widget. From
> this list you can click on a contact to edit the details. If you click on
> someone in the list on the first page, everything works fine. However, if I
> click to a different page in the list, and then click on a contact to edit,
> the HTML comes up 'funny'.
>
> Here is a screen shot of the way it's supposed to be (my apologies to those
> not viewing with HTML):
>
>
>
> ...and here is what it looks like when you have the problem:
>
>
> It's like the widgets are getting chopped off or something. Not sure if my
> comments about the pagination are a red herring or whether it is really the
> cause. The problem appears on the page AFTER the datagrid page with the
> pagination. Also, the 'problem' display is not always like that. Sometimes
> it displays the submit button with the text 'Save'. I'm really confused and
> don't know where to look.
>

1. What browser are you using. Is there an option to turn off cache.
2. Stop, wait, remove .pyc files and start you apache service.
3. make sure all files have the right permission.

I run into similar problems of caching, and I fixed it by removing pyc
and making sure web server user have permission to read/write to
files.


As far as cut off html...(not sure about that. Might be you css or something)

Lucas

Jim Steil

unread,
Jun 20, 2008, 10:46:41 AM6/20/08
to turbo...@googlegroups.com
Thanks for your reply Lucas. 

I'm using Firefox.  But, users of IE are seeing the same thing.  I cleared my cache and refreshed, but got the same results.  I have not tried clearing the .pyc files yet but will do so.  I'm using the same CSS on both dvlp and production so I don't think that's the case.  Also, the page displays fine in production until you've clicked on one of the paginate pages prior to it.  But, once you've click on a pagination page, you'll have the problem until you restart your browser.

    -Jim

Jim Steil

unread,
Jun 20, 2008, 11:11:20 AM6/20/08
to turbo...@googlegroups.com
Also, I should have mentioned that this is what the very end of the HTML looks like when it fails:

		</tr>
		</div>
	</table>
	</fieldset>
			</div>
		</div>
		<td><input type="submit" class="submitbutton"

All of the closing tags are missing and part of the input tag is gone as well.  It appears as though it is just cutting off mid-stream while it's generating the html.  I'm using Genshi for rendering. 

    -Jim

Roger Demetrescu

unread,
Jul 18, 2008, 4:48:53 PM7/18/08
to TurboGears
On Jun 20, 12:11 pm, Jim Steil <st...@mailbag.com> wrote:
<CUT>
> Also, I should have mentioned that this is what the very end of the HTML
> looks like when it fails:
>
>                 </tr>
>                 </div>
>         </table>
>
>         </fieldset>
>                         </div>
>                 </div>
>                 <td><input type="submit" class="submitbutton"
>
> All of the closing tags are missing and part of the input tag is gone as
> well.  It appears as though it is just cutting off mid-stream while it's
> generating the html.  I'm using Genshi for rendering.

This is indeed weird... you are not supposed to have enclosing DIV
between
enclosing TR and TABLE tags.

Jim, I know it may be something hard to accomplish, but we really need
a small project that show this bug happening.

Try to quickstart a new project, and improve it until the bug appears.
If you accomplish this task, open a ticket and submit a ZIP file with
the project source, and your tg-info as well (try to preserve your
current environment.. your current turbogears, genshi, etc..
packages).

Or you can do the opposite: make a copy of your project and start
removing features (model tables, controllers and templates not
directly used by a page that reproduces the error) as long as
the bug still happens.

Also don't forget that your tables data may have something
that causes the problem. Before you pack the buggy application,
please provide an sqlite with the same table structure and data
(beware it doesn't contain any sensible information)


Cheers,

Roger

Jim Steil

unread,
Jul 18, 2008, 5:06:06 PM7/18/08
to turbo...@googlegroups.com
Well, I don't know if that would even help.  This all works just fine when run from my development box (XP Pro) but doesn't work on my production boxes (Win2003).  I've done fresh installs of the entire Python environment as well as TG and all sub-components on both the 2003 boxes and XP Pro.  Code is the same, I use SVN populated the app using the repository.  Data is the same.  From my development box I can hit either test or production databases and it works fine.  I don't think it has anything to do with HTML that it doesn't like, it's not even sending the HTML to the browser.

As you can see from my other post today, I'm kind of past thinking that I can fix this.  I really believe it has something to do with Paginate, but don't have the experience to dig into it sufficiently to find out.  Hence the question on how others handle their pagination and app navigation.

I'm assuming the problem is somewhere in Genshi, but don't know how to dig in and find it.

What I probably really need is a better way to manage my pagination.  I should look into an AJAX pagination data grid widget maybe.  Anyone recommend anything?

    -Jim

Lukasz Szybalski

unread,
Jul 18, 2008, 5:18:08 PM7/18/08
to turbo...@googlegroups.com


And just to make sure. Your problem has nothing to do with something like this:
http://groups.google.com/group/turbogears/browse_thread/thread/11d1fa77286eab6f

Have you tried it?
Lucas

Jim Steil

unread,
Jul 18, 2008, 5:23:44 PM7/18/08
to turbo...@googlegroups.com
Ok, now to make things even weirder...

It just occurred to me that on both of my production machines I was running this on port 80 and on my development machine it was on port 8081.  So, on one of the production machines I switched the port to listen on 8081.  Guess what?  The problem went away.  Is this a red herring, or useful info?  Also, I hit the other production machine by specifying port 80 on the URL in my browser and it too then 'almost' worked.  It displayed the page as it should, but it is missing a logo at the bottom of the page.  Seems like it is consistent and reproducible on my end. 

Does any of this make any sense to anyone?  Certainly not to me.

    -Jim

Jim Steil

unread,
Jul 18, 2008, 5:32:15 PM7/18/08
to turbo...@googlegroups.com
Thanks Lucas, but I already have this value set to True.

    -Jim

Roger Demetrescu

unread,
Jul 19, 2008, 11:07:01 AM7/19/08
to turbo...@googlegroups.com
On Fri, Jul 18, 2008 at 18:23, Jim Steil <st...@mailbag.com> wrote:
> Ok, now to make things even weirder...
>
> It just occurred to me that on both of my production machines I was running
> this on port 80 and on my development machine it was on port 8081. So, on
> one of the production machines I switched the port to listen on 8081. Guess
> what? The problem went away. Is this a red herring, or useful info? Also,
> I hit the other production machine by specifying port 80 on the URL in my
> browser and it too then 'almost' worked. It displayed the page as it
> should, but it is missing a logo at the bottom of the page. Seems like it
> is consistent and reproducible on my end.

Interesting...


Is there any firewall/anti-virus software between your machine and the
production
machine that could be messing up the contents of your page ?

As an example: AVG anti-virus some time destroys a HTML message when
it insert its message telling me that there are no viruses in the message.

Maybe you are suffering from the same thing...

What you could try to do is: surf your development pages (one that contains
the paginate datagrid) and then do a copy & paste of the generated html
and save it in a static file in your production machine.
Then you try to access it and see if the page still looks strange...

Try also to browse your app directly from you production machine...


> Does any of this make any sense to anyone? Certainly not to me.

Hehehehe.. that is a bonus for working with computer science... :D


Cheers,

Roger

Jim Steil

unread,
Jul 21, 2008, 1:49:57 PM7/21/08
to turbo...@googlegroups.com

Roger

Thanks for the reply.  I don't believe that antivirus can be blamed for this.  We are experiencing this on machines running AVG, Kaspersky, Symantec, Avast, etc.  These are just the ones I know about, but it happens regardless of the AV component being used.  I don't believe it is a firewall issue because it happens inside our firewall, outside our firewall and on the local machine itself.

This morning I setup Apache in front of the CherryPy server and used mod_proxy to proxy port 80 on Apache to 8080 on CherryPy.  This all works fine.  This problem only appears when I'm using port 80 on CherryPy. 

Can anyone think of any reason why this would be the case?

    -Jim

Roger Demetrescu

unread,
Jul 21, 2008, 2:33:59 PM7/21/08
to turbo...@googlegroups.com
On Mon, Jul 21, 2008 at 14:49, Jim Steil <st...@mailbag.com> wrote:
> Roger Demetrescu wrote:
> Roger
>
> Thanks for the reply. I don't believe that antivirus can be blamed for
> this. We are experiencing this on machines running AVG, Kaspersky,
> Symantec, Avast, etc. These are just the ones I know about, but it happens
> regardless of the AV component being used. I don't believe it is a firewall
> issue because it happens inside our firewall, outside our firewall and on
> the local machine itself.
>
> This morning I setup Apache in front of the CherryPy server and used
> mod_proxy to proxy port 80 on Apache to 8080 on CherryPy. This all works
> fine. This problem only appears when I'm using port 80 on CherryPy.
>
> Can anyone think of any reason why this would be the case?

Unfortunately I am getting out of ideas on what could be causing this.. :(

Just to be sure: when you said "and on the local machine itself" you mean
on the windows 2003 server, right ?

Have you tried the approach of saving the generated output on your
development machine and try to serve it as a static file by cherrypy
(using port 80) ?

Only do check if it is something related to paginate/widgets or not...

Cheers,

Roger

Jim Steil

unread,
Jul 22, 2008, 10:45:37 AM7/22/08
to turbo...@googlegroups.com
Upon further checking, it appears as though I was incorrect about the AV running on the computers that had the problem.  It turns out that the people reporting problems on systems outside of our internal network were not using their company laptops.  Instead, they were logging in on a company computer at another site.  So, this means that all of the people experiencing this problem ARE using 1 AV product, Kaspersky.  I did a quick test this morning and have found that I can effect the situation by enabling or disabling components of the Kaspersky AV product. 

So Roger, you previous post was right on target.  Sorry to have misled everyone.  I will pursue with Kaspersky support and see what we can come up with.  Thanks again to everyone spent some time thinking about this one.

    -Jim

Roger Demetrescu

unread,
Jul 22, 2008, 11:07:20 AM7/22/08
to turbo...@googlegroups.com
On Tue, Jul 22, 2008 at 11:45, Jim Steil <st...@mailbag.com> wrote:
<SNIP>

> Upon further checking, it appears as though I was incorrect about the AV
> running on the computers that had the problem. It turns out that the people
> reporting problems on systems outside of our internal network were not using
> their company laptops. Instead, they were logging in on a company computer
> at another site. So, this means that all of the people experiencing this
> problem ARE using 1 AV product, Kaspersky. I did a quick test this morning
> and have found that I can effect the situation by enabling or disabling
> components of the Kaspersky AV product.
>
> So Roger, you previous post was right on target. Sorry to have misled
> everyone. I will pursue with Kaspersky support and see what we can come up
> with. Thanks again to everyone spent some time thinking about this one.
>
> -Jim


Glad to help ! :)


Cheers,

Roger

Roger Demetrescu

unread,
Jul 22, 2008, 11:15:29 AM7/22/08
to turbo...@googlegroups.com
On Tue, Jul 22, 2008 at 11:45, Jim Steil <st...@mailbag.com> wrote:
> So Roger, you previous post was right on target. Sorry to have misled
> everyone. I will pursue with Kaspersky support and see what we can come up
> with. Thanks again to everyone spent some time thinking about this one.

Ops, forgot to mention...


When you and Kaspersky support find a solution, could you give us a feedback ?

Sharing this kind of experience may be useful to other people.

Thanks,

Roger

Jim Steil

unread,
Jul 22, 2008, 11:48:49 AM7/22/08
to turbo...@googlegroups.com
I will certainly update the list with the results.  I've been on the line with them since my last post.  We've narrowed it down to a couple of the specific services they provide, but haven't found an acceptable workaround yet.  Obviously we could turn those services off (Web Anti-Virus and Anti-Spy) but then, I'm not getting the protection that they provide.  So, we're continuing to dig into it.

    -Jim

Jim Steil

unread,
Jul 22, 2008, 12:06:08 PM7/22/08
to turbo...@googlegroups.com
Ok, just disconnected with Kaspersky.  The guy said he had to do some work on this and would get back to me.  I'll follow-up with what I hear.

    -Jim
Reply all
Reply to author
Forward
0 new messages