Forums Instiki

Bugs

Subscribe to Bugs 90 posts, 8 voices

 
Andrew Stacey 118 posts

Talking about cache bugs (nlab thread), I think I just came up against another incarnation of The Dreaded Cache Bug of Bexhill on Sea. I was reorganising pages on my course wiki. I had a page that used to be a single page and now I wanted to split it into several. The stuff on that page was to go on one of the sub-pages, so I renamed that page. But I wanted to use the original page name as the main page. So I removed the automatically inserted redirect. Then I saved the page. The original page was still in the cache. As I wanted to create that page anyway, I manually entered the “new/page name” URL and that worked (“edit/page name” did not).

 
distler Moderator 123 posts

I’m not so sure I understand.

  1. I created a page, “Foo”.
  2. I edited the page, “Foo”, and changed the name to “Bar”.
  3. I removed the [[!redirects Foo]] directive, and saved the page.

All instances of “Foo” were successfully removed from the Cache.

What am I missing?

 
Andrew Stacey 118 posts

edited 12 years ago

Looking at the log, what I see is the following:

Processing WikiController#save (for 2001:700:300:1470:862b:2bff:fe9b:c741 at 2011-09-21 14:32:27) [POST]
  Parameters: {"_form_key"=>"809867e64bcc18bbdd650af99b67f93dd935dfad", "content"=>"A load of content",
"alter_title"=>"1", "new_name"=>"norm for continuous functions on the interval", "author"=>"Andrew Stacey",
"web"=>"mathsnotes", "id"=>"continuous functions on the interval"}
Reading page 'continuous functions on the interval' from web 'mathsnotes'
Page 'continuous functions on the interval'  found
2001:700:300:1470:862b:2bff:fe9b:c741
Reading page 'continuous functions on the interval' from web 'mathsnotes'
Page 'continuous functions on the interval'  found
Maruku took 0.002904876 seconds.
Maruku took 0.002353689 seconds.
Maruku took 0.310123551 seconds.
Maruku took 0.301577887 seconds.

At that point, I get lots of Expired fragments, all of which refer to the new page name (or to lists). Then at the end, I see:

Redirected to http://mathsnotes.math.ntnu.no/mathsnotes/show/norm+for+continuous+functions+on+the+interval
Completed in 789ms (DB: 18) | 302 Found [http://mathsnotes.math.ntnu.no/mathsnotes/save/continuous+functions
+on+the+interval]

Seconds later, I go back to the tab with the original page in it and click “reload” to get:

Processing WikiController#show (for 2001:700:300:1470:862b:2bff:fe9b:c741 at 201
1-09-21 14:32:39) [GET]
  Parameters: {"web"=>"mathsnotes", "id"=>"continuous functions on the interval"}
Reading page 'continuous functions on the interval' from web 'mathsnotes'
Page 'continuous functions on the interval' not found
Cached fragment hit: views/mathsnotes/show/continuous+functions+on+the+interval (0.1ms)
Filter chain halted as [#<ActionController::Filters::AroundFilter:0x00000003585248
@kind=:filter, @method=#<Proc:0x00000003585680@/home/stacey/current/others/instiki/vendor/rails/actionpack/
lib/action_controller/caching/actions.rb:64>, @identifier=nil, @options={:only=>#<Set: {"show", "published",
"authors", "tex", "s5", "print", "recently_revised", "list", "file_list", "source", "history", "revision",
"atom_with_content", "atom_with_headlines"}>, :if=>#<Proc:0x00000003585888@/home/stacey/current/others/
instiki/app/controllers/wiki_controller.rb:13>, :unless=>nil}>] did_not_yield.
Completed in 3ms (View: 0, DB: 1) | 200 OK [http://mathsnotes.math.ntnu.no/mathsnotes/show/
continuous+functions+on+the+interval]

In other words, the cached version is there.

(Edit: “A load of content” is a substantial amount.)

 
distler Moderator 123 posts

Are you using the current revision of Instiki? ‘Cuz that’s not the behaviour I see, when I follow the steps above.

 
Andrew Stacey 118 posts

I was on 759. I’ll upgrade today.

I was also probably doing something more complicated than I described, only I can’t remember all the steps, since I was moving content from one page to another and renaming them. I thought I’d described the important ones, but there may have been something that I’d missed.

I’ll try to be more observant of my own behaviour in case it occurs again!

 
Andrew Stacey 118 posts

edited 12 years ago

Here’s a maruku bug; I guess I’m noting it as much for when (if!) you change engines as for hoping that it’ll get fixed now.

In a theorem or proof environment, the conversion of the h6 element to a label doesn’t always work correctly if the following element is a block-level one (list or a div, for example).

I’ve been trying to post an example here, but failing miserably. Even the correct syntax doesn’t seem to be working. So I’ve stuck an example at the top of the Sandbox in the nLab:

http://ncatlab.org/nlab/show/Sandbox

(I originally noticed this on my course wiki.)

 
distler Moderator 123 posts

Sorry.

Maruku’s HTML output looks perfectly OK (ie, as expected) in your example(s). (View the XHTML source, and tell me what you think is wrong with it.)

What you are complaining about is that the CSS doesn’t produce the desired appearance of the output.

Since you’ve been mucking about with the CSS of the Theorem Environment, why don’t you muck about some more and get it to format your example correctly.

 
Andrew Stacey 118 posts

What are you using to show the source? My default is Firebug, though I also use the “View Source Chart” addon. Here’s what Firebug says it sees:

<div id="thmA" class="num_theorem">
<p>
<span class="theorem_label">Theorem</span>
<span>. </span>
Correct behaviour
</p>
</div>
<div id="thmB" class="num_theorem">
<ol>
<span class="theorem_label">Theorem</span>
<span>. </span>
<li>A list, with</li>
<li>Incorrect behaviour</li>
</ol>
</div>
<div id="thmC" class="num_theorem">
<div style="float: right;">
<span class="theorem_label">Theorem</span>
<span>. </span>
<p>A comment to one side</p>
</div>
<p>The theorem</p>
</div>

In particular, note that the second theorem label is a child of the <ol> element.

If I just do the naive “View Source” then this is what I see:

<div class='num_theorem' id='thmA'>
<h6 id='theorem_1'>Theorem</h6>

<p>Correct behaviour</p>
</div>

<div class='num_theorem' id='thmB'>
<h6 id='theorem_2'>Theorem</h6>

<ol>
<li>A list, with</li>

<li>Incorrect behaviour</li>
</ol>
</div>

<div class='num_theorem' id='thmC'>
<h6 id='theorem_3'>Theorem</h6>

<div style='float: right;'>
<p>A comment to one side</p>

</div>

<p>The theorem</p>
</div>

So you’re right and wrong. What I’m seeing on the page is not an artefact of Maruku. Since the source sent by Instiki is correct, my guess is that it is Javascript that is converting the <h6> to a <span> and is inserting it as a child of the first element. (In my opinion, it should do so only if that first element is a <p>, otherwise it should be in a block element all of its own.)

 
distler Moderator 123 posts

Ah. I see.

Thanks.

 
Andrew Stacey 118 posts

This is probably related to that last one. Is the black square inserted at the end of a proof also done by javascript? If so, that might be worth thinking about whether or not it makes the same assumption. In particular, if a proof ends with a bit of displayed maths then the square gets inserted into the containing div which is centred. This looks a little odd.

 
admin Administator 63 posts

Indeed.

 
Andrew Stacey 118 posts

edited 12 years ago

New one for you. This one’s possibly the most obscure yet!

The wiki doesn’t like ampersands in file names; that is, in the [[file|filename :file]] syntax (or whatever the right syntax is). This feels a bit like a “my head hurts when I hit it with a hammer” bug! Obviously, no sane person would put an ampersand in a file name. I did so by accident and it threw “Internal application error” in my face. It was only by looking at the logs that I realised what I’d done. The logs have:

ActionController::RoutingError (No route matches {:controller=>"file", :web=>"mathsnotes",
 :action=>"file", :id=>"lecture.annotations.2011-10-0&.pdf"}):
  lib/url_generator.rb:83:in `file_link'
  lib/url_generator.rb:43:in `make_link'

(and a whole load more “in XYZ”s - I presume that the whole trace isn’t necessary)

 
admin Administator 63 posts

This one’s possibly the most obscure yet!

Not terribly obscure at all. But it does highlight how overloaded the WikiLink mechanism is. Ugly as sin!

This is probably not the right fix. But it’s a fix.

 
Andrew Stacey 118 posts

edited 12 years ago

I just updated my course installation to the latest one, did the ruby bundle and touch tmp/restart.txt as well. Then I tried to edit the stylesheet and kept getting Internal Application Error. Here’s what the log said:

RuntimeError (Instiki could not create directory to store uploaded files. Please
 make sure that Instiki is allowed to create directory /home/stacey/current/others/instiki/webs/
mathsnotes/files/0 and add files to it.):
  app/models/web.rb:169:in `rescue in create_files_directory'
  app/models/web.rb:161:in `create_files_directory'
  app/models/wiki.rb:32:in `edit_web'
  app/controllers/admin_controller.rb:59:in `edit_web'

There’s no reason why Instiki can’t create that directory, but I’m a bit at a loss as to why it is trying to do so.

I restarted the web server and got the same error.

 
admin Administator 63 posts

D’oh!

 
Andrew Stacey 118 posts

Thanks! That’s great.

On another topic, is there any progress on cache bugs? With the file uploading, then it doesn’t work at all. When I upload a file to a page then that page doesn’t get expired. We’re also seeing it with renaming pages on the nLab. We’re trying to keep a record of it in case it’s of use to you: http://www.math.ntnu.no/~stacey/Mathforge/nForum/comments.php?DiscussionID=3168

 
admin Administator 63 posts

On another topic, is there any progress on cache bugs?

I’ll take a look, again, at file uploads.

For the other, you have not been able to present me with a set of steps to reproduce the bug. So there’s nothing that I can do.

 
Andrew Stacey 118 posts

When there are style_additions then the surrounding <style> ... </style> appears to get escaped. I noticed this on a published web: in the source, it says:

&lt;style type='text/css'&gt;.newWikiWord { background-color: white; font-style: italic; }&lt;/style&gt;

So presumably in line 31 of layouts/default.rhtml, which reads:

<%= "<style type='text/css'>#{@style_additions}</style>" if @style_additions %>

then there’s some HTML escaping going on that shouldn’t be.

 
admin Administator 63 posts

Thanks.

 
vax3200 1 post

edited 12 years ago

I just created a fresh install of instiki (0.19.3) on mac osx snow leopard. Ruby 1.9.3 (ruby 1.9.3p6 (2011-12-13 revision 34018) x86_64-darwin10.8.0).

After running through the usual steps to download dependencies, tried kicking off ./instiki. Consistently got the following error: ...instiki/instiki-0.19.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:186:in require’: cannot load such file – admin_helper (LoadError) from …instiki/instiki-0.19.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:186:in require' from ...instiki/instiki-0.19.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:293:in require_or_load’ from …instiki/instiki-0.19.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:252:in depend_on' from ...instiki/instiki-0.19.3/vendor/rails/activesupport/lib/active_support/dependencies.rb:163:in require_dependency’ from …instiki/instiki-0.19.3/vendor/rails/actionpack/lib/action_controller/helpers.rb:198:in default_helper_module!'

After banging my head for several hours and inserting debug statements, I figured that it is looking for the file ‘admin_helper’ which does not exist in any folder. I created a dummy file /instiki-0.19.3/app/helpers/admin_helper.rb with an empty modue AdminHelper. Similarly, created another file /instiki-0.19.3/app/helpers/file_helper.rb

Now instiki starts up fine, and I am able to create a few pages.

What could be going wrong?

 
distler Moderator 123 posts

That’s pretty strange. I have not been able to reproduce the problem.

Obviously, having dummy /app/helper/admin_helper.rb and /app/helper/file_helper.rb files does no harm, but I’m puzzled by the fact that they seem to be necessary for you.

 
dietg 4 posts

Hi, I’m trying out Instiki 0.19.3 on Mac OS X Snow Leopard and am running into an issue when publishing a Web. On each page (at the top) I get displayed:

<style type='text/css'>.newWikiWord { background-color: white; font-style: italic; }</style>

in the Browser. This is apparently caused by a line:

&lt;style type='text/css'&gt;.newWikiWord { background-color: white; font-style: italic; }&lt;/style&gt;

placed in the HTML source. Any ideas how to fix that?

 
dietg 4 posts

Another issue: after installing a new version if Instiki I wanted to import the extisting content from the old installation. There’s a nice feature to export content, but I could not find an import feature. Is there one?

Thanks in advance for good hints!

 
admin Administator 63 posts

Hi, I’m trying out Instiki 0.19.3 on Mac OS X Snow Leopard and am running into an issue when publishing a Web. On each page (at the top) I get displayed: …

That’s a bug, which was fixed in Revision 770.

Grab a copy of the latest development version (or get it from my BZR repository or from Github).

Another issue: after installing a new version if Instiki I wanted to import the extisting content from the old installation.

You can copy over your old database, and then follow the upgrade instructions to update the schema to the latest version.

 
dietg 4 posts

I installed the latest development version, and the bug with the schema is gone indeed. Thanks! The content is also migrated with some hand-work… A nice Import feature would be really helpful. Any plans?

Now I’m struggling with something else: The (normal) text of my Web is displayed in a rather large font. Much larger than it is displayed for example on the “Edit Web” page. I see font-size: 1em in instiki.css, which looks fine to me, so I can’t explain it. I’d like to have a “normal” font size, so I’m tweaking the style sheet, defining a proper font-size for my Web on body, but then the Edit Web page’s font gets too small…

Q: what do I need to do to get Instiki chosing a normal font size for my Web by default?

Thanks again for good hints.

 
admin Administator 63 posts

Q: what do I need to do to get Instiki chosing a normal font size for my Web by default?

You might try setting the font-size on #Content. But I’m puzzled: is the font-size different from what you see on my Instiki site (which should be the same as the font-size here). Or are those also too large for your taste?

 
dietg 4 posts

Your page is a good example for what I wanted to say. The content text is large (even larger than on this page, I believe), in contrast to the table of contents text which is rather “normal” size, similar to how most Web pages out there would show up in my browser. I would expect, that Instiki does not enlarge the content text by default, but leave it to the page designer to tune the font size, if (s)he thinks it’s needed.

 
Bernhard Sta... 4 posts

Apparently, math is completely broken in Opera 12. I installed Opera 12 today and since then, I’ve been getting “Error parsing MathML: ErrorUnknown source” errors in place of every formula. Firefox works fine, so it’s not a server bug.

On http://golem.ph.utexas.edu/wiki/instiki/show/Sandbox I get the error message, while the demos from http://www.mathjax.org/demos/ work without complaint, so I guess it’s an instiki or itex2mml bug - or a bug in Opera, of course.

 
jl345 6 posts

Hi!

I was experimenting around, trying to migrate this wiki to PostgreSQL 9.1.4, following your instructions, and I think there was a little bug in instiki-0.19.4/lib/tasks/fixtures.rake, line 77, where it looks like a string was escaped for a regular expression, but then it was being matched as a literal string with all the extra backslashes. After I think I more or less fixed this, I was able to run

$ env RAILS_ENV=production bundle exec rake db:migrate --trace

$ env RAILS_ENV=production bundle exec rake db:fixtures:import_all --trace

Now my database has all the tables in it, populated with rows, and I can view the pages, but when I try to edit a page, there is an error, because it looks like the primary keys were not set up properly on these tables, so I’m still trying to figure this out. Any ideas? (I think I need to make sure there is utf8 support, too…)

Thanks!

 
jl345 6 posts

Ahh!

I figured out what went wrong with my PostgresQL import. The tables were just fine in fact; just the last sequence numbers for all the primary keys had all gotten set to one for some reason. It worked fine once I got the sequence numbers adjusted to the last row in each table, so now my installation of Instiki appears to be working great on PostgreSQL.

Again, Instiki is an awesome wiki, and I’m already using it to take math notes and such for stuff I have to learn.

Forums Instiki