racket / racket-pkg-website

A frontend for the Racket Package Catalog.
Other
9 stars 15 forks source link

Exception while adding a version exception #27

Closed SuzanneSoy closed 7 years ago

SuzanneSoy commented 7 years ago

I tried to add a version to one of my packages, and got this error message when I clicked on "Save changes". The version was not added.

Exception
The application raised an exception with the message:

jsexpr->string: expected argument of type <legal JSON value>; given: '#s((git-source parsed-package-source 3) "https://github.com/jsmaniac/hyper-literate.git#ae152d4ab9058a77128cad7c7aab839b99f3f5d9" "hyper-literate" git https "github.com" #f "jsmaniac/hyper-literate.git" "ae152d4ab9058a77128cad7c7aab839b99f3f5d9" "")
Stack trace:

loop at:
  line 103, column 2, in file /home/pkgserver/racket/collects/json/main.rkt
loop at:
  line 103, column 2, in file /home/pkgserver/racket/collects/json/main.rkt
for-loop at:
  line 118, column 11, in file /home/pkgserver/racket/collects/json/main.rkt
loop at:
  line 103, column 2, in file /home/pkgserver/racket/collects/json/main.rkt
write-json* at:
  line 69, column 0, in file /home/pkgserver/racket/collects/json/main.rkt
jsexpr->string29 at:
  line 228, column 0, in file /home/pkgserver/racket/collects/json/main.rkt
simple-json-rpc! at:
  line 79, column 0, in file /home/pkgserver/racket-pkg-website/src/jsonp-client.rkt
save-draft! at:
  line 1247, column 0, in file /home/pkgserver/racket-pkg-website/src/site.rkt
<unknown procedure> at:
  line 1166, column 0, in file /home/pkgserver/racket-pkg-website/src/site.rkt
<unknown procedure> at:
  line 340, column 33, in file /home/pkgserver/racket/collects/racket/contract/private/arrow-higher-order.rkt
SuzanneSoy commented 7 years ago

A quick update on this issue:

After trying to add the version exception in the old pkgs.racket-lang.org interface, and refreshing the page, the version exception disappeared.

After a few attempts, the version exception seemed to be taken into account (it showed up on the new interface at least, not sure about the old interface).

However, I got this error message when installing the package on that Racket version:

raco pkg install: cannot use empty checksum for Git repostory package source
  source: https://github.com/jsmaniac/hyper-literate.git#ae152d4ab9058a77128cad7c7aab839b99f3f5d9

Here's the full (short) Travis log for the build which failed with that error:

https://travis-ci.org/jsmaniac/remember/jobs/184599797

SuzanneSoy commented 7 years ago

A second update:

My hyper-literate package was constantly marked as "modified since the package index was last rebuilt", at each rebuild.

As a last resort, I tried removing the package altogether from the catalog, and re-adding it. It is now listed on pkgn.racket-lang.org, but does not seem to be part of the catalog, and is still constantly marked as "modified since the package index was last rebuilt":

raco pkg install: cannot find package on catalogs
  package: hyper-literate

A lot of my packages depend on this one, what can I do about this (aside from using a new name?).

tonyg commented 7 years ago

Hi @jsmaniac, I'm looking into this now.

tonyg commented 7 years ago

I'm sorry for the problems, @jsmaniac. I suspect that what must have happened is that the error adding the version led to a "locally modified" record being maintained by the system that then got out of sync with the backend version when it was directly modified by the old UI. I suspect that if the version-adding problem hadn't arisen, we would not have seen concurrent conflicting modifications arise.

The actions for me are:

  1. fix the version-adding problem, which should be easy to track down and repair
  2. fix the concurrency/consistency problem, which is much harder

For now, lacking time, I have restarted the frontend server, which should flush the broken transient state and revert to the permanent information in the package database. This should let you do what you need to do.

I will leave this bug report open. If anything else goes wrong, please add more information here or to a new issue. Thanks, and sorry not to have a solid fix available yet!

SuzanneSoy commented 7 years ago

@tonyg Thanks a lot for looking into this issue! Concurrency problems are definitely the worst :) .

There still seems to be some issues with package creation though:

Sorry about the trouble.

tonyg commented 7 years ago

@jsmaniac Thanks again, that's good stuff. I will be taking a more detailed look at these and other issues with the package catalog system today.

SuzanneSoy commented 7 years ago

@tonyg Thanks a lot, everything seems to be fixed now!

tonyg commented 7 years ago

@jsmaniac, Please try adding your version exception again. It should work now. Thanks!

SuzanneSoy commented 7 years ago

@tonyg It worked, thanks for the fix!