talk@lists.collectionspace.org

WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org

View all threads

error adding new term through UI in 2.4

JM
Jesse Martinez
Tue, Jul 24, 2012 3:45 PM

Hi all,

I'm getting an interesting error when attempting to add a new term to
a dynamic term list via the Administration panel. I'm running a
modified version of 2.4. The services log shows this

2012-07-24 15:35:01,376 ERROR [http-8180-11]
[org.collectionspace.services.vocabulary.VocabularyResource:440]
org.collectionspace.services.vocabulary.VocabularyResource detail:
java.lang.NumberFormatException: Bad value for: pgNum
-- message: Bad value for: pgNum
-- Stack Trace:
--      java.lang.NumberFormatException: Bad value for: pgNum
at org.collectionspace.services.common.document.DocumentFilter.setStartPage(DocumentFilter.java:382)
at org.collectionspace.services.common.document.DocumentFilter.setPagination(DocumentFilter.java:187)
...first 4 lines. 52 more.

And it appears that this malformed URL is to blame:

2012-07-24 15:35:01,157 DEBUG [http-8180-11]
[org.collectionspace.services.common.security.SecurityInterceptor:104]
received GET on
vocabularies/7b61d381-be6b-4799-b577/items?pgSz=40&pgNum=1?pgSz=40&pgNum=2&wf_deleted=false

Is anyone else running a modified 2.4 stack seeing this error?

What layer would be responsible for this? My hunch is the App...

  • Jesse
Hi all, I'm getting an interesting error when attempting to add a new term to a dynamic term list via the Administration panel. I'm running a modified version of 2.4. The services log shows this 2012-07-24 15:35:01,376 ERROR [http-8180-11] [org.collectionspace.services.vocabulary.VocabularyResource:440] org.collectionspace.services.vocabulary.VocabularyResource detail: java.lang.NumberFormatException: Bad value for: pgNum -- message: Bad value for: pgNum -- Stack Trace: -- java.lang.NumberFormatException: Bad value for: pgNum at org.collectionspace.services.common.document.DocumentFilter.setStartPage(DocumentFilter.java:382) at org.collectionspace.services.common.document.DocumentFilter.setPagination(DocumentFilter.java:187) ...first 4 lines. 52 more. And it appears that this malformed URL is to blame: 2012-07-24 15:35:01,157 DEBUG [http-8180-11] [org.collectionspace.services.common.security.SecurityInterceptor:104] received GET on vocabularies/7b61d381-be6b-4799-b577/items?pgSz=40&pgNum=1?pgSz=40&pgNum=2&wf_deleted=false Is anyone else running a modified 2.4 stack seeing this error? What layer would be responsible for this? My hunch is the App... - Jesse
RL
Ray Lee
Tue, Jul 24, 2012 10:16 PM

Hi Jesse,
I haven't seen that one, but we haven't been using dynamic term lists that much. It does look like an app layer bug. Is this only happening with term lists that have more than 40 items? CSPACE-4877 was a bug in how the app layer was handling updates to term lists with more than 40 items. It was fixed around 2.2, but this looks like it might be a bug in that fix.

Ray

On Jul 24, 2012, at 8:45 AM, Jesse Martinez wrote:

Hi all,

I'm getting an interesting error when attempting to add a new term to
a dynamic term list via the Administration panel. I'm running a
modified version of 2.4. The services log shows this

2012-07-24 15:35:01,376 ERROR [http-8180-11]
[org.collectionspace.services.vocabulary.VocabularyResource:440]
org.collectionspace.services.vocabulary.VocabularyResource detail:
java.lang.NumberFormatException: Bad value for: pgNum
-- message: Bad value for: pgNum
-- Stack Trace:
--      java.lang.NumberFormatException: Bad value for: pgNum
at org.collectionspace.services.common.document.DocumentFilter.setStartPage(DocumentFilter.java:382)
at org.collectionspace.services.common.document.DocumentFilter.setPagination(DocumentFilter.java:187)
...first 4 lines. 52 more.

And it appears that this malformed URL is to blame:

2012-07-24 15:35:01,157 DEBUG [http-8180-11]
[org.collectionspace.services.common.security.SecurityInterceptor:104]
received GET on
vocabularies/7b61d381-be6b-4799-b577/items?pgSz=40&pgNum=1?pgSz=40&pgNum=2&wf_deleted=false

Is anyone else running a modified 2.4 stack seeing this error?

What layer would be responsible for this? My hunch is the App...

  • Jesse

Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org

Hi Jesse, I haven't seen that one, but we haven't been using dynamic term lists that much. It does look like an app layer bug. Is this only happening with term lists that have more than 40 items? CSPACE-4877 was a bug in how the app layer was handling updates to term lists with more than 40 items. It was fixed around 2.2, but this looks like it might be a bug in that fix. Ray On Jul 24, 2012, at 8:45 AM, Jesse Martinez wrote: > Hi all, > > I'm getting an interesting error when attempting to add a new term to > a dynamic term list via the Administration panel. I'm running a > modified version of 2.4. The services log shows this > > 2012-07-24 15:35:01,376 ERROR [http-8180-11] > [org.collectionspace.services.vocabulary.VocabularyResource:440] > org.collectionspace.services.vocabulary.VocabularyResource detail: > java.lang.NumberFormatException: Bad value for: pgNum > -- message: Bad value for: pgNum > -- Stack Trace: > -- java.lang.NumberFormatException: Bad value for: pgNum > at org.collectionspace.services.common.document.DocumentFilter.setStartPage(DocumentFilter.java:382) > at org.collectionspace.services.common.document.DocumentFilter.setPagination(DocumentFilter.java:187) > ...first 4 lines. 52 more. > > > And it appears that this malformed URL is to blame: > > 2012-07-24 15:35:01,157 DEBUG [http-8180-11] > [org.collectionspace.services.common.security.SecurityInterceptor:104] > received GET on > vocabularies/7b61d381-be6b-4799-b577/items?pgSz=40&pgNum=1?pgSz=40&pgNum=2&wf_deleted=false > > > Is anyone else running a modified 2.4 stack seeing this error? > > What layer would be responsible for this? My hunch is the App... > > - Jesse > > _______________________________________________ > Talk mailing list > Talk@lists.collectionspace.org > http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
PS
Patrick Schmitz
Tue, Jul 24, 2012 11:27 PM

Looks to me like this bug is still in current code.
ConfiguredVocabStorage.java, updateJSON has a rather naïve view of
pagination. I think it needs to copy the basepath near line 833, and then
use this on line 861 when it calls getRestrictedPath() with the pagination
info. Problem is that it is glomming query params onto an URL that already
has params.

This would be better solved if the block of code specified a pageSize of 0,
which would fetch all the elements in one call. This is a little expensive
for huge vocabularies, but should generally be okay.

We'll create a JIRA for this. Should probably be assigned to 2.7.

Patrick

-----Original Message-----
From: talk-bounces@lists.collectionspace.org
[mailto:talk-bounces@lists.collectionspace.org] On Behalf Of
Jesse Martinez
Sent: Tuesday, July 24, 2012 8:45 AM
To: CollectionSpace Talk List
Subject: [Talk] error adding new term through UI in 2.4

Hi all,

I'm getting an interesting error when attempting to add a new
term to a dynamic term list via the Administration panel. I'm
running a modified version of 2.4. The services log shows this

2012-07-24 15:35:01,376 ERROR [http-8180-11]
[org.collectionspace.services.vocabulary.VocabularyResource:440]
org.collectionspace.services.vocabulary.VocabularyResource detail:
java.lang.NumberFormatException: Bad value for: pgNum
-- message: Bad value for: pgNum
-- Stack Trace:
--      java.lang.NumberFormatException: Bad value for: pgNum
at
org.collectionspace.services.common.document.DocumentFilter.se
tStartPage(DocumentFilter.java:382)
at
org.collectionspace.services.common.document.DocumentFilter.se
tPagination(DocumentFilter.java:187)
...first 4 lines. 52 more.

And it appears that this malformed URL is to blame:

2012-07-24 15:35:01,157 DEBUG [http-8180-11]
[org.collectionspace.services.common.security.SecurityInterceptor:104]
received GET on
vocabularies/7b61d381-be6b-4799-b577/items?pgSz=40&pgNum=1?pgS

z=40&pgNum=2&wf_deleted=false

Is anyone else running a modified 2.4 stack seeing this error?

What layer would be responsible for this? My hunch is the App...

  • Jesse

Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.c
ollectionspace.org

Looks to me like this bug is still in current code. ConfiguredVocabStorage.java, updateJSON has a rather naïve view of pagination. I think it needs to copy the basepath near line 833, and then use this on line 861 when it calls getRestrictedPath() with the pagination info. Problem is that it is glomming query params onto an URL that already has params. This would be better solved if the block of code specified a pageSize of 0, which would fetch all the elements in one call. This is a little expensive for huge vocabularies, but should generally be okay. We'll create a JIRA for this. Should probably be assigned to 2.7. Patrick > -----Original Message----- > From: talk-bounces@lists.collectionspace.org > [mailto:talk-bounces@lists.collectionspace.org] On Behalf Of > Jesse Martinez > Sent: Tuesday, July 24, 2012 8:45 AM > To: CollectionSpace Talk List > Subject: [Talk] error adding new term through UI in 2.4 > > Hi all, > > I'm getting an interesting error when attempting to add a new > term to a dynamic term list via the Administration panel. I'm > running a modified version of 2.4. The services log shows this > > 2012-07-24 15:35:01,376 ERROR [http-8180-11] > [org.collectionspace.services.vocabulary.VocabularyResource:440] > org.collectionspace.services.vocabulary.VocabularyResource detail: > java.lang.NumberFormatException: Bad value for: pgNum > -- message: Bad value for: pgNum > -- Stack Trace: > -- java.lang.NumberFormatException: Bad value for: pgNum > at > org.collectionspace.services.common.document.DocumentFilter.se > tStartPage(DocumentFilter.java:382) > at > org.collectionspace.services.common.document.DocumentFilter.se > tPagination(DocumentFilter.java:187) > ...first 4 lines. 52 more. > > > And it appears that this malformed URL is to blame: > > 2012-07-24 15:35:01,157 DEBUG [http-8180-11] > [org.collectionspace.services.common.security.SecurityInterceptor:104] > received GET on > vocabularies/7b61d381-be6b-4799-b577/items?pgSz=40&pgNum=1?pgS z=40&pgNum=2&wf_deleted=false > > > Is anyone else running a modified 2.4 stack seeing this error? > > What layer would be responsible for this? My hunch is the App... > > - Jesse > > _______________________________________________ > Talk mailing list > Talk@lists.collectionspace.org > http://lists.collectionspace.org/mailman/listinfo/talk_lists.c > ollectionspace.org >