ArctosDB / arctos

Arctos is a museum collections management system
https://arctos.database.museum
60 stars 13 forks source link

[external CONTACT] Issues Accessing the API #8136

Open pccollins2 opened 5 days ago

pccollins2 commented 5 days ago

Hi Dusty & Michelle,

I figured I'd move the issues from our email thread to here. Following up from my recent email, here is the current issue with UAMNH. You mentioned the previous semester's group (with Ben Brunson) was under the IP of 129.114.., which I have no knowledge of where that IP came from. Does the entire project need to be moved to the IP we are currently using? I've included my reply to your previous email below:

I am unsure as to whether or not the IP address within the AIME Building or UA domain has changed, but our external IP addresses from the computers we are currently working with is 130.160.124.*

Here's the error we get in Visual Studio when trying to search through the front end while running the webpage locally:

System.AggregateException: 'One or more errors occurred. (Response status code does not indicate success: 401 (Unauthorized).)'

dustymc commented 5 days ago

IP of 129.114.., which I have no knowledge

That's the production UI - it's still up so I presume someone is maintaining it and wants it up?! @jcabbott72

dig +short arctos.museums.ua.edu
129.114.97.203

System.AggregateException: 'One or more errors occurred. (Response status code does not indicate success: 401 (Unauthorized).)'

That's not coming from the Arctos API, if any diagnostics are necessary I'll need to know what's actually happening.

@mkoo (traveling and may be slow to respond) I think this is a request for a dev key for 130.160.124.* but I'm hesitant to just issue until questions are cleared up.

pccollins2 commented 5 days ago

After looking further into the situation, that 129.114.97.203 address is the server (TACC) hosting the web application all the way in Texas.

I'm assuming we would need a dev key for 130.160.124.*, but I am unsure as to why this hasn't been an issue for previous teams

Edit: So apparently there was a previous test API key burried deep in the code that allegedly works for 130...* but I get the following error about the request timing out. Image 9-26-24 at 3 20 PM

pccollins2 commented 4 days ago

Here's another view of the error, but on the webpage itself Screenshot 2024-09-26 170331

pccollins2 commented 4 days ago

Here is a tracert from our 130...* address to http://arctos-test.tacc.utexas.edu/component/api/v2/catalog.cfc?method=getCatalogData

image

dustymc commented 4 days ago

Thanks, that helps (but text would be nice!).

I've emailed a new key and test endpoint to @jcabbott72.

pccollins2 commented 1 day ago

Hi Dusty,

Thanks for getting back with a new key. Unfortunately, we are still getting an error with the new key/link (thankfully it's not the same one as before).

System.AggregateException: 'One or more errors occurred. (Invalid URI: Invalid port specified.)'

dustymc commented 1 day ago

I need to know the request to and response from Arctos in order to provide any information.

pccollins2 commented 1 day ago

An unhandled exception occurred while processing the request. AggregateException: One or more errors occurred. (Invalid URI: Invalid port specified.) System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)

UriFormatException: Invalid URI: Invalid port specified. System.Uri.CreateThis(string uri, bool dontEscape, UriKind uriKind, ref UriCreationOptions creationOptions)

Stack Query Cookies Headers Routing AggregateException: One or more errors occurred. (Invalid URI: Invalid port specified.) System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions) System.Threading.Tasks.Task.GetResultCore(bool waitCompletionNotification) System.Threading.Tasks.Task.get_Result() Capstone_Museum.Controllers.SearchResultsController.EthnologyResults(Search searchObj) in SearchResultsController.cs + List results = SearchResult.GetResults(searchObj, "ALMNH:EH").Result; lambda_method73(Closure , object , object[] ) Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Show raw exception details UriFormatException: Invalid URI: Invalid port specified. System.Uri.CreateThis(string uri, bool dontEscape, UriKind uriKind, ref UriCreationOptions creationOptions) System.Uri..ctor(string uriString, UriKind uriKind) System.Net.Http.HttpClient.CreateUri(string uri) System.Net.Http.HttpClient.GetStringAsync(string requestUri) Capstone_Museum.Models.SearchResult.GetResults(Search search, string guidPrefix) in SearchResult.cs + string response = await client.GetStringAsync(url); //return object from api call

Show raw exception details

pccollins2 commented 22 hours ago

Is this what you needed, or were you referring to something else? If not, let me know where I can find it

dustymc commented 21 hours ago

That is not what I need, Arctos did not make that. I need the actual http request and response.

pccollins2 commented 21 hours ago

This is what I got as a response in Postman. It included a 401 unauthorized response, but I can't find any specific details. Still not sure if this is what you're looking for, so if not, please direct me on which specific parts you need and where I can find them.

<!DOCTYPE html>

Database Access

Welcome to Arctos!

By accessing this content, you are agreeing to all terms of the Arctos Community Data Policy and indicating that you are aware of our Acknowledgment of Harmful Content.

Please start with the Arctos API Policy for access by automation.

You must log in, create an account, or agree to the terms above to view this content.

</div>
pccollins2 commented 21 hours ago

{"error":"Unauthorized","Message":"Invalid API key: (redacted) from 130.160.124.1","recordsTotal":"null","recordsFiltered":"null","draw":1}

dustymc commented 21 hours ago

That's better, I'm not sure what happened, I bounced the api, try again please.

pccollins2 commented 20 hours ago

Still getting the same thing and a 401 error

dustymc commented 20 hours ago

What URI are you attempting to access?

pccollins2 commented 20 hours ago

xxx along with the test API key you provided John Abbot

dustymc commented 20 hours ago

Thanks, try now.

dustymc commented 20 hours ago

(and please don't post that URL in a public repo)

pccollins2 commented 20 hours ago

Nothing, still getting the same result/error.

I apologize, I thought the key was the only sensitive part

dustymc commented 20 hours ago

How about now? (And sorry for the "wiggle the wires" experience! I fixed a bug, it works for me, I think something's cached, hopefully restarted the last bit of that now.)

pccollins2 commented 20 hours ago

Still nothing :( We're getting the same error/result

dustymc commented 19 hours ago

Blargh, how about now?

pccollins2 commented 19 hours ago

No :(

dustymc commented 19 hours ago

You are not doing anything at all that I can see. Maybe the stuck cache is on your end?!

I dropped the IP restrictions on the key,

{the URL I send you}/component/api/v2/catalog.cfc?method=getCatalogData&guid_prefix=ALMNH:Paleo&queryformat=struct&api_key=18E3D79B-.....

returns data for me.

Do you have some time we can zoom tomorrow? I'd like to see your screen and my logs at the same time.

pccollins2 commented 18 hours ago

Yes, 5:00pm central works best for my team, but I can make 2:00pm work if needed

dustymc commented 18 hours ago

3 Pacific works.

pccollins2 commented 25 minutes ago

Hey Dusty, The API is working, I was testing the API incorrectly the last couple of times, so no need to Zoom. Thanks so much for your help!