Evergreen ILS Website

IRC log for #evergreen, 2026-05-15

| Channels | #evergreen index | Today | | Search | Google Search | Plain-Text | summary | Join Webchat

All times shown according to the server's local time.

Time Nick Message
06:56 collum joined #evergreen
08:41 mmorgan joined #evergreen
09:26 Dyrcona joined #evergreen
10:07 gmcharlt csharp_: I shall do what I want... and not ignore yoU!
10:12 Dyrcona "Testing. Please delete." :)
10:27 Dyrcona Are 19 parameters too many? Someone is going to complain they are not enough.
10:27 Dyrcona I guess really there are only 17 that the user can control. The other two are given by the framework.
10:48 goood and in the end, you only need one: query :)
10:49 BDorsey joined #evergreen
10:50 Dyrcona True, but.....
10:52 csharp_ gmcharlt: thank you for your service
10:52 Dyrcona Well, here's a surprise: I've added the first two boolean parameters.
10:53 csharp_ one thing we can't ignore is that a few mail reputation sites had marked list.evergreen-ils.org as bad
10:53 csharp_ pretty sure it's password-reset generated spam
10:56 Dyrcona goood: For Boolean parameters, will it accept anything other than true or false?
10:57 Dyrcona "It" being the openapi_server and apparatus.
10:59 Dyrcona I'm wondering if I can get away with using OpenILS::Application::Apputils::is_true or if I should implement my own version for OpenAPI booleans?
11:00 goood I believe it expects JSON-ish values. sec...
11:01 goood yep: https://swagger.io/docs/specification​/v3_0/data-models/data-types/#boolean
11:01 goood just, exactly, true and false
11:01 Dyrcona OK, so this should work: $docache = $U->is_true(lc($docache));
11:02 Dyrcona Probably don't need the lc.
11:02 goood if it's nullable, obviously null is allowed and can be considered either false or "some third value", but .. yeah, we treat it as false
11:03 Dyrcona It's optional.
11:04 Dyrcona Should I add a default_value of false?
11:05 Dyrcona I'll do that. Makes sense anyway that it's false if it is missing, at least for these tow options.
11:05 goood meh, if it's not true, it's false. I think that ends up being a JSON::Boolean (or similar)
11:06 Dyrcona No documentation found for "JSON::Boolean".
11:06 goood (I don't have a strong opinion on default values, unless it serves a functional purpose)
11:08 goood ah, it's just JSON::true and JSON::false. for testing in stringy or int-y ways automatically: https://metacpan.org/pod/JSON#JSON%3A%3Ais_bool
11:09 goood anyway, they're safe to test directly in openapi-side code, looks like
11:13 Dyrcona I see: "They are overloaded to act almost exactly like the numbers 1 and 0." Guess I'll just go with what I've got and see what happens. Hopefully, I'll make enough progress to test today.
11:14 Dyrcona See if this works: $docache = {docache=>$docache};
11:16 Dyrcona goood: It looks like the parameters are passed to the controller function in the order that they're listed in the endpoint table entry.
11:16 goood yes, exactly
11:19 goood method_params lets you define the opeapi param mapping to the perl backend, so, for instance, you can pass a static value to the handler to change it's behavior. there are some that are reused because they do the same work with different params in different positions. like the verify-by-barcode and verify-by-username, IIRC
11:20 goood mainly, it's the named-parameter to positional-parameter mapping we need to be able to pass through to opensrf methods
11:20 goood which makes it familiar to opensrf developers, and understandable to openapi developers
11:22 goood (though, similar to opensrf where you get the method object as an invocant (and the client handle), you get the controller object as the invocant for Advanced Stuff(tm))
11:23 Dyrcona Yeah, so this:     my ($c, $ses, $title, $author, $subject, $series, $keyword, $identifier, $isbn, $issn, $org_unit, $depth, $limit, $offset, $sort, $sort_dir, $tag_circulated_records, $query, $docache) = @_;
11:26 goood that sure is exercising every possible option! :D
11:27 goood tbh, I don't recall top-level isbn and issn, but if the code says it works...
11:27 Dyrcona Well, the ones that make sense. It's not possible to have arbitrary options is it? like ?search_format=X
11:28 goood no, you have to define them all, but you could add (say) a facet param and then include information about the facet type and value in the param value
11:29 Dyrcona What should I do with string values in a limited range? Should I return a 400 if they're out of range?
11:30 goood and it is possible (at the openapi level) to define structured params that get exploded into their parts, like facet={type:foo,value:[bar,baz]}, but our openapi param parser doesn't handle that yet
11:30 goood strings in a range?
11:30 goood like, an org_unit that doesn't map to a shortname?
11:30 Dyrcona sort_dir is either asc or desc, or sort can be 1 of puddate, author, or title.
11:31 goood ah! well, there's an enum type. not sure if I've used that (or support it yet, tbh) ... sec
11:32 goood (oh, and sort can be those 3, OR any record attribute that is marked as a sorter, or some special values like "rel" and "poprel")
11:33 Dyrcona Well..... Dunno if I wan to get into that. I'm not parsing the query string where I think you can also specify sort.
11:34 Dyrcona I've never tried to figure out what happens if you try to use both the arghash and query string sort.
11:34 goood ah, no enum support yet in the schema datatype table. so, I think just make sure it's a simple string and let the backend figure it out
11:35 goood for sort, I mean
11:35 Dyrcona Would take a lot of code to implement enum support? I'm not sure where to begin, tbh.
11:37 goood it would not be trival. it might be simpler to define a regex for string-type params that can be used to validate it
11:38 Dyrcona OK, I'll use a regex in my code for now. We can figure out refactoring it to the database and openapi_server later.
11:38 goood +1
11:39 Dyrcona I'm trying to get this done so I can put it on a test server by Wednesday.
11:39 goood that would be 99% in support of the openapi description doc and schema we deliver, for client code generation
11:39 goood (and docs/"explanations" can cover that for us here)
11:40 Dyrcona That was something I noticed. I didn't see anyway to add a description to parameters for the Swagger docs. Is that not part of the OpenAPI specs?
11:43 goood it is supported by v3.0, yes. the schema has "example" and "examples/summary" properties for that: https://swagger.io/docs/specif​ication/v3_0/adding-examples/
11:44 goood we could add cols to openapi.endpoint_param to hold those
11:45 goood (and enums might be less hard than I first thought, but still db and code changes that aren't NECESSARY today. maybe as part of v1 promotion?)
11:45 Dyrcona Maybe in time for 4.0?
11:46 goood oh, almost definitely not
11:47 Dyrcona ok
11:48 goood but if a vendor's willing to start using your local additions now, v1 doesn't seem like a hard requirement
11:48 Dyrcona I was thinking by the Evergreen 4.0 release in the fall. You don't think we could knock out enums and descriptions this summer?
11:50 Dyrcona I also wonder what kind of validation/scrubbing I should do on the inputs. For most of the strings, I probably need to remove punctuation and maybe duplicate spaces.
12:02 jihpringle joined #evergreen
12:07 goood (meeting time) anything's possible, but I can't guarantee time or a completion target
12:13 goood IMO, we shouldn't modify user input, just (at most) validate and error if it's not to our liking
12:14 goood (that DOES suggest enum, min/max, and regex support, but we can do it in the handler for now)
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:19 jihpringle à
12:20 csharp_ keyboard cat!
12:20 jihpringle it was indeed :)
12:20 csharp_ jihpringle++
12:20 * csharp_ watches jeff reholster his moderator guns
12:39 collum joined #evergreen
13:16 Dyrcona heavy use was made of skeletons and keyboard macros during the production of this code: https://www.gnu.org/software/emacs/m​anual/html_node/autotype/index.html
13:53 * Dyrcona listens to The Steve Miller Bad in honor of updating to Linux Kernel 7.0.7 this morning.
14:03 Bmagic lol
14:28 Dyrcona Path: /search/multiclass?title=alchemist&author=coelho
14:28 Dyrcona {"errors":[{"message":"Internal Server Error.","path":"\/"}],"status":500}
14:31 Dyrcona And that's about all I have to go on. Nothing in the nginx error.log
14:35 * Dyrcona decides to stop logging to syslog on this test vm.
14:40 goood Dyrcona: you may see more useful info in the console where you start the server, not certain. but you def won't see anything useful in the nginx log if you get to the point of seeing that error structure
14:41 Dyrcona goood: Not really: [2026-05-15 14:41:06.17516] [3212] [error] [gWs5kphvWvj9] Exception! at /usr/share/perl5/Error.pm line 484.
14:41 goood that's almost certiainly bubbling up through basic_handler_wrapper in openapi_server
14:42 goood ok, so it is likely a problem in the handler, or behind it, that's throwing an error or calling die()
14:43 Dyrcona grepping gWs5kphvWvj9 turns up not much. I can check the log table in the db.
14:43 goood that is just the request id
14:43 goood it's a random string
14:43 Dyrcona Yeah, but there's associated log entries.
14:44 Dyrcona Nothing indicating an error.
14:44 goood is the wip branch more or less up to date?
14:45 Dyrcona grep ERR just turns up a bunch of osrfStringArrayAdd messages.
14:45 Dyrcona Yeah, the wip branch is what I'm using. Relevant stuff is all in the top commit.
14:49 goood +1
14:52 goood I see a couple typos: open-ils.search.biblio.multiclasse (note the "e" at the end), and a single "|" instead of "||" for ORing things together
14:52 Dyrcona goood++
14:52 goood (not sure that's what we want to do there, regardless ...
14:52 Dyrcona I figured it had to be a typo somewhere.
14:53 goood you /should/ be seeing the "no method called multiclasse" in the opensrf logs, though
14:53 goood modulo exact words, obv
14:55 Dyrcona Nope. :/
14:55 goood womp womp
14:58 goood I know the opensrf method definition says docache is supposed to be an object, but ... it doesn't look like that's true
14:58 Dyrcona Ok.
14:58 goood it's just a bool (flag) param
15:00 Dyrcona Y'know. I thought I saw that yesterday, then looking at the doc comments this morning I thought, "I must have been mistaken."
15:01 goood it's dealer's choice if that defaults to true ... IIRC, we send 0 for that in searches with the #staff modifier, and some special cases re metarecord searching, but otherwise send a 1
15:01 goood default to true /here/ I mean
15:02 mmorgan1 joined #evergreen
15:02 Dyrcona OK. It's just code, we can always change it. :)
15:03 Dyrcona After I get a successful search, I'll change the default in my database and restart the openapi server.
15:05 Dyrcona Meh. Still an interal server error. Do I have to restart all services?
15:05 goood no, just openapi_server
15:07 Dyrcona So, I'll just start dumping the params. They'll show up in the console, won't they?
15:08 goood unsure ... they'll show up somewhere! you should be able to use the standard logger to log to the opensrf logs, I think?
15:09 goood but, lemme see what your result stuff looks like. the bare call returns an arrayref of arrayrefs, I think
15:09 Dyrcona so, I should probably have array for the result type. I'll bet that's my problem.
15:10 goood yeah, it does validate result structure
15:10 Dyrcona can I do schema_type 'array' array_items 'array'?
15:11 * Dyrcona tries it.
15:11 goood you could just say `return {foo => $U->simple...}''`
15:11 goood yes
15:12 Dyrcona I'll try the double array. If that doesn't work, I'll go back to object with {results => ....}
15:12 Dyrcona I want this to be as thin a wrapper as possilbe.
15:12 Dyrcona possible, even...
15:16 Dyrcona Meh. still not working...
15:17 Dyrcona I'm going to set validate to false to see if that makes a difference.
15:19 Dyrcona Nope. There's a problem elsewhere still.
15:28 Dyrcona "syntax OK"
15:34 Dyrcona Weird. If I do query= and nothing else. I get to a line that I added that dumps \%arghash. If do the title&author one. I don't get there.
15:35 Dyrcona I added another line above that to dumpe the searches hash. I don't get there, either.
15:45 Dyrcona Something is wrong with add_to_hash, but i don't see it, and Perl's not giving me any hints.
15:46 Dyrcona So, we'll go back to the repetitious version.
15:51 Dyrcona OMG! Another typo...
15:51 Dyrcona Grr.
15:52 Dyrcona Perl should have complained about a misspelled function name.
15:53 goood ha! join_paramaters ... just saw that
15:53 Dyrcona No 'use strict; use warnings;' that's why no errors form perl -c...
15:54 Dyrcona That's what you get when you own 2 tow trucks: a par'amaters...
15:54 goood yeah, perl -wc didn't warn me either
15:55 Dyrcona still not working.
15:55 Dyrcona ugh I made a typo fixing the typo...
15:55 Dyrcona I need to slow down.
15:58 Dyrcona Ok. I'm not getting the fields with default values: offset, limit, etc.
16:00 Dyrcona think I'll check for errors, etc.
16:04 jihpringle joined #evergreen
16:09 Dyrcona OK. Yet another typo.... Dunno why Perl doesn't catch more of these.
16:10 Dyrcona If it weren't typos, I'd have no type at all.... Another one after fixing that one.
16:12 Dyrcona I had multiple typos in the "my $U = 'OpenILS::Application::AppUtils'; line... preventing $U->simplereq from working/being called, but Perl didn't notice other than just blowing up at runtime.
16:12 csharp_ @quote add < Dyrcona> If it weren't typos, I'd have no type at all....
16:12 pinesol csharp_: The operation succeeded.  Quote #259 added.
16:14 Dyrcona Now, the quetion becomes can we run multiclass search from simplereq, because it appears to not work.
16:15 Dyrcona Looks like mojolicious timed out.
16:16 Dyrcona Attempting to build a client session as a server Session ID
16:16 Dyrcona yeahp. gonna have to do this differently, I think.
16:17 goood heh... seems like it should work, though. it works for other handler wrappers
16:18 Dyrcona I'm going to remove my print Dumper code and see what happens. I think the search just may be too slow, but this machine had a pingest run recently. Maybe I need to reindex metabib tables?
16:19 goood :shrug:
16:20 Dyrcona The Isbn retrieval was fast.
16:20 goood gather (used in simplereq) has an explicit 60s timeout, if that matters
16:21 Dyrcona I got a line from mojolicious about 120 seconds in the console. After that, I got the message I pasted above, that I assume was what I got back from simplereq, but maybe it wasn't.
16:24 Dyrcona [2026-05-15 16:23:27.17192] [4394] [error] Worker 4397 has no heartbeat (50 seconds), restarting (see FAQ for more)
16:24 Dyrcona [2026-05-15 16:23:27.17223] [4394] [info] Stopping worker 4397 gracefully (120 seconds)
16:24 Dyrcona Attempting to build a client session as a server Session ID [1778876554.14091134
16:24 Dyrcona Again with those messages.
16:26 Dyrcona I think it is just timing out.
16:40 goood well, if need's be, it's easy to adjust the timeout (we could make it configurable). in opensrf_server, change the ->start line to something like: app->secrets(scalar time)->heartbeat_timeout(180)->start;
16:40 Dyrcona i'm reindexing using some code I swiped from Bmagic. :)
16:43 Dyrcona I may stop services on the other vm using this db server, too, but I don't think it is doing anything.
16:45 Dyrcona It should not take 2 minutes for an author/title search to return.
16:46 Dyrcona Adjusting the timeout is a bad idea.
16:54 Dyrcona This reindex isn't going to finish before 5:00 PM.
16:55 goood you could watch pg_stat_activity and see if your search is running. if so, I'd say push the typo-free version for others to look at
16:56 Dyrcona goood: The typo-free version is pushed. That's how I was putting it on the test machine.
16:57 goood woot
16:57 Dyrcona I plan to make a clean branch before sharing for real.
16:57 goood +1
16:57 goood again, /very/ happy someone's adding some API fun!
16:57 goood thank!
16:57 Dyrcona I have the db upgrade in a different directory for now.
16:57 goood Dyrcona++
16:57 Dyrcona Aw, shucks....
16:59 Dyrcona it doesn't look like the search is still running. I'll look for the OPAC or other code that runs search. Maybe it needs to stream or something?
17:00 Dyrcona But that might wait until Monday.
17:00 Bmagic Dyrcona++
17:01 mmorgan1 left #evergreen
17:01 Dyrcona I'm signing out for now.
18:39 jihpringle joined #evergreen
22:55 book` joined #evergreen

| Channels | #evergreen index | Today | | Search | Google Search | Plain-Text | summary | Join Webchat