Errors when accessing docs or metas with no cache #195

Closed
opened 6 years ago by otherjoel · 7 comments
otherjoel commented 6 years ago (Migrated from github.com)

I am seeing some errors I did not expect when using get-doc and get-metas on documents that aren't yet cached. Here are steps to recreate the problem:

  1. Create a new empty folder
  2. Create a pollen.rkt consisting of only one line, #lang racket
  3. Create an example.html.pm consisting of some token Pollen markup, e.g.:
#lang pollen
◊h1{Example title}
◊p{Hello world}
  1. In DrRacket, create a new file, sandbox.rkt in the same folder. Save the file with these contents:
#lang racket
(require pollen/core)
  1. With DrRacket open to this sandbox.rkt file, click Run, then at the REPL, enter (get-metas 'example.html) (or get-doc)

Upon doing this, I receive an error:

../../../../../Applications/Racket v6.12/share/pkgs/errortrace-lib/errortrace/errortrace-lib.rkt:256:58: require: namespace mismatch;
 reference to a module that is not available
  reference phase: 0
  referenced module: "/Applications/Racket v6.12/share/pkgs/errortrace-lib/errortrace/errortrace-key.rkt"
  referenced phase level: 0
  compilation context...: in: errortrace-key
  1. At the command line, from within the project folder, do raco pollen render example.html, which should complete without problems.
  2. If at this point I re-do step 5 above, it works with no errors.
  3. If I do raco pollen reset, then do step 5 above (clicking Run again to restart the REPL), I again get the error.

I should expect to be able to use get-doc and get-metas no matter what the state of the cache is, correct?

This is with Pollen version 2.0.2038.749 on Racket 6.12 on macOS 10.14.3.

I am seeing some errors I did not expect when using `get-doc` and `get-metas` on documents that aren't yet cached. Here are steps to recreate the problem: 1. Create a new empty folder 2. Create a `pollen.rkt` consisting of only one line, `#lang racket` 3. Create an `example.html.pm` consisting of some token Pollen markup, e.g.: ``` #lang pollen ◊h1{Example title} ◊p{Hello world} ``` 4. In DrRacket, create a new file, `sandbox.rkt` in the same folder. Save the file with these contents: ``` #lang racket (require pollen/core) ``` 5. With DrRacket open to this `sandbox.rkt` file, click _Run_, then at the REPL, enter `(get-metas 'example.html)` (or `get-doc`) Upon doing this, I receive an error: ``` ../../../../../Applications/Racket v6.12/share/pkgs/errortrace-lib/errortrace/errortrace-lib.rkt:256:58: require: namespace mismatch; reference to a module that is not available reference phase: 0 referenced module: "/Applications/Racket v6.12/share/pkgs/errortrace-lib/errortrace/errortrace-key.rkt" referenced phase level: 0 compilation context...: in: errortrace-key ``` 6. At the command line, from within the project folder, do `raco pollen render example.html`, which should complete without problems. 7. If at this point I re-do step 5 above, it works with no errors. 8. If I do `raco pollen reset`, then do step 5 above (clicking _Run_ again to restart the REPL), I again get the error. I should expect to be able to use `get-doc` and `get-metas` no matter what the state of the cache is, correct? This is with Pollen version 2.0.2038.749 on Racket 6.12 on macOS 10.14.3.
mbutterick commented 6 years ago (Migrated from github.com)

Hmm, I can't reproduce this (on Racket 7.1). The msg is coming from errortrace, which is weird. Have you tried doing raco setup errortrace-lib?

Hmm, I can't reproduce this (on Racket 7.1). The msg is coming from `errortrace`, which is weird. Have you tried doing `raco setup errortrace-lib`?
otherjoel commented 6 years ago (Migrated from github.com)
$ raco setup errortrace-lib
collection-path: collection not found
  collection: "errortrace-lib"
  in collection directories:
   /Users/joel/Library/Racket/6.12/collects
   /Applications/Racket v6.12/collects
   ... [185 additional linked and package directories]

$ raco pkg show --all | grep errortrace
 errortrace*                  e63c664f79bb0...  catalog...rtrace
 errortrace-doc*              104c0b4b878fa...  catalog...ce-doc
 errortrace-lib*              f7873118981ce...  catalog...ce-lib
``` $ raco setup errortrace-lib collection-path: collection not found collection: "errortrace-lib" in collection directories: /Users/joel/Library/Racket/6.12/collects /Applications/Racket v6.12/collects ... [185 additional linked and package directories] $ raco pkg show --all | grep errortrace errortrace* e63c664f79bb0... catalog...rtrace errortrace-doc* 104c0b4b878fa... catalog...ce-doc errortrace-lib* f7873118981ce... catalog...ce-lib ```
mbutterick commented 6 years ago (Migrated from github.com)

Maybe raco setup errortrace? Sorry for the human experimentation. Usually the message "reference to a module that is not available" indicates out-of-date compiled files.

Maybe `raco setup errortrace`? Sorry for the human experimentation. Usually the message "reference to a module that is not available" indicates out-of-date compiled files.
otherjoel commented 6 years ago (Migrated from github.com)

raco setup errortrace worked fine but did not affect the problem.

Then I went a little overboard and did raco setup --clean followed by raco setup — still did not fix the problem.

Then I installed Racket 7.2, then installed pollen from within the 7.2 DrRacket (user scope). The problem does not occur with 7.2

Finally I deleted my 6.12 installation, downloaded and reinstalled 6.12 fresh from the Racket website, and reinstalled pollen (user scope). The problem does reoccur in this situation.

`raco setup errortrace` worked fine but did not affect the problem. Then I went a little overboard and did `raco setup --clean` followed by `raco setup` — still did not fix the problem. Then I installed Racket 7.2, then installed pollen from within the 7.2 DrRacket (user scope). The problem does not occur with 7.2 Finally I deleted my 6.12 installation, downloaded and reinstalled 6.12 fresh from the Racket website, and reinstalled pollen (user scope). The problem does reoccur in this situation.
mbutterick commented 6 years ago (Migrated from github.com)

OK, thanks for the detail. I'll look into this shortly on 6.12.

OK, thanks for the detail. I'll look into this shortly on 6.12.
mbutterick commented 6 years ago (Migrated from github.com)

I’ve installed Racket 6.12 (on OS X 10.14.1) and can't yet reproduce the issue. Another idea: does the issue still surface if you choose "No debugging or profiling" in the DrRacket Choose Language box?

screen shot 2019-03-04 at 10 27 34 pm
I’ve installed Racket 6.12 (on OS X 10.14.1) and can't yet reproduce the issue. Another idea: does the issue still surface if you choose "No debugging or profiling" in the DrRacket Choose Language box? <img width="406" alt="screen shot 2019-03-04 at 10 27 34 pm" src="https://user-images.githubusercontent.com/1425051/53785387-2d419000-3ecd-11e9-9c20-1915db9927d6.png">
otherjoel commented 6 years ago (Migrated from github.com)

Changing that setting does seem to fix the problem in 6.12 DrRacket.

Also, interestingly, I can no longer reproduce the problem in the CLI REPL for 6.12 (by just running racket at the prompt). I did encounter it there too at least once, but that was in the context of my original project, before I created the MVE and opened this issue.

So given that you can't reproduce it, it seems likely the problem is/was on my end, and not a problem in Pollen at any rate.

Changing that setting does seem to fix the problem in 6.12 DrRacket. Also, interestingly, I can no longer reproduce the problem in the CLI REPL for 6.12 (by just running `racket` at the prompt). I did encounter it there too at least once, but that was in the context of my original project, before I created the MVE and opened this issue. So given that you can't reproduce it, it seems likely the problem is/was on my end, and not a problem in Pollen at any rate.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#195
Loading…
There is no content yet.