Problem downloading package from git actions, results in mangled URL - github-actions

In our git actions output for testing our custom R package (hosted on github), we're experiencing an error during execution:
Error in utils::download.file(url, path, method = method, quiet = quiet, :
cannot open URL 'https://api.github.com/repos/***/CirceR/contents/DESCRIPTION?ref=HEAD'
Calls: saveRDS ... github_DESCRIPTION -> download -> base_download -> base_download_headers
Execution halted
Error: Process completed with exit code 1.
The main repo is here: https://github.com/OHDSI/CohortGenerator
The github actions report is here: https://github.com/OHDSI/CohortGenerator/runs/3294257207?check_suite_focus=true
The referenced package CirceR is found here: https://github.com/ohdsi/circer
Our main question is: is it normal for the requested URL for the DESCRITPION file to be masked with the *** as in: cannot open URL 'https://api.github.com/repos/***/CirceR/contents/DESCRIPTION?ref=HEAD'
If we change the *** to the actual organization OHDSI for this URL the request works, so is it possible the URL is being mangled?
We've tested loading each individual package locally and this error doesn't occur, so we think it's localized to github actions.

I believe the output is trying to shorten the string so you can see how it starts, and how it ends, but not the middle...for readability purposes. My issue was I wanted the entire contents of the string (other errors in 'shorter' repository names gives the full URL). So, I believe this truncation is by design.
To solve the underlying issue, I had to specify a GIT_PAT to use to invoke the API and that cleared out the error I was getting.

Related

WebAssembly crash info in window.onerror()

I am trying to collect crash logs for my WebAssembly application. It's built with emscripten, everything is served from the same domain, testing in Chrome. In the developer console I see a proper error with stack trace when a crash occurs, I'd like to capture this and send it to a server.
Instead I am only getting "Script error." passed to window.onerror() and the fifth parameter is null. This is supposed to happen when violating the same-origin policy (linked question is only about javascript, does not talk about this WebAssembly-specific problem.) Errors occurring in the .js file don't have this problem, only webassembly runtime errors.
I added the crossorigin attribute to the .js file generated by emscripten. The site is running in secure context, the Response object passed to WebAssembly.instantiateStreaming() (in the emscripten-generated .js file) has "basic" as its .type, so as I understand it has no restrictions on what can be done with it. "Access-Control-Allow-Origin" header is set to "*".
For some weird reason I managed to get the full error with stack trace exactly once, so it is apparently possible, but seemingly doing everything the same way I can't get it to work again.
How can this be solved?
instantiateStreaming is promised based so maybe try window.addEventListener('unhandledrejection')?

Zabbix web scenario debug

To figure out the problems in web scenario I need to check values of variables (macros) in some steps. I expect view in Web interface...
Currently log is accessible only from system, but there is an ugly workaround to view variables:
Add step to not existing URL with variable in path, for example:
https://{HOST.DNS}/{some_variable}/{some_other_variable}
server probably return error page, but you can set is as expected in Required status codes
set Required string to an not existing on error page, for example "not existing string"
then in details of web scenario you can see status:
Error: required pattern "not existing string" was not found on https://some.dns/some_variable_value/some_other_variable_value

How to handle "Unexpected EOF at target" error from API calls?

I'm creating a Forge application which needs to get version information from a BIM 360 hub. Sometimes it works, but sometimes (usually after the code has already been run once this session) I get the following error:
Exception thrown: 'Autodesk.Forge.Client.ApiException' in mscorlib.dll
Additional information: Error calling GetItem: {
"fault":{
"faultstring":"Unexpected EOF at target",
"detail": {
"errorcode":"messaging.adaptors.http.flow.UnexpectedEOFAtTarget"
}
}
}
The above error will be thrown from a call to an api, such as one of these:
dynamic item = await itemApi.GetItemAsync(projectId, itemId);
dynamic folder = await folderApi.GetFolderAsync(projectId, folderId);
var folders = await projectApi.GetProjectTopFoldersAsync(hubId, projectId);
Where the apis are initialized as follows:
ItemsApi itemApi = new ItemsApi();
itemApi.Configuration.AccessToken = Credentials.TokenInternal;
The Ids (such as 'projectId', 'itemId', etc.) don't seem to be any different when this error is thrown and when it isn't, so I'm not sure what is causing the error.
I based my application on the .Net version of this tutorial: http://learnforge.autodesk.io/#/datamanagement/hubs/net
But I adapted it so I can retrieve multiple nodes asynchronously (for example, all of the nodes a user has access to) without changing the jstree. I did this to allow extracting information in the background without disrupting the user's workflow. The main change I made was to add another Route on the server side that calls "GetTreeNodeAsync" (from the tutorial) asynchronously on the root of the tree and then calls it on each of the returned children, then each of their children, and so on. The function waits until all of the nodes are processed using Task.WhenAll, then returns data from each of the nodes to the client;
This means that there could be many api calls running asynchronously, and there might be duplicate api calls if a node was already opened in the jstree and then it's information is requested for the background extraction, or if the background extraction happens more than once. This seems to be when the error is most likely to happen.
I was wondering if anyone else has encountered this error, and if you know what I can do to avoid it, or how to recover when it is caught. Currently, after this error occurs, it seems that every other api call will throw this error as well, and the only way I've found to fix it is to rerun the code (I use Visual Studio so I just rerun the server and client, and my browser launches automatically)
Those are sporadic errors from our apigee router due to latency issues in the authorization process that we are currently looking into internally.
When they occur please cease all your upcoming requests, wait for a few minutes and retry again. Take a look at stuff like this or this to help you out.
And our existing reports calling out similar errors seem to point to concurrency as one of the factors leading up to the issue so you might also want to limit your concurrent requests and see if that mitigate the issue.

Angular 6 PWA -- The PWA functionality is interefering with Azure Adal Authentication, not sure how to bypass it

I have a PWA built with Angular 6 and the #angular/pwa npm package and authenticating using adal-angular4 npm package (but could just rebuild that from scratch if needed -- the issue isn't a bug in the package I think)
When attempting to authenticate, although it does work, users are very often greeted with this message of not found (screenshot of console but its the same).
This especially seems to be the case if you are already authenticated to another (or itself) Azure AD product. Where it normally should only load for a while and then let the user in.
Service worker error transcript:
Failed to load 'link.com/#LONGTOKEN' A serviceWorker passed a promise
to FetchEvent.respondWith() that rejected with 'Error: Response not Ok
(fetchAndCacheOnce): request for LINK.com/index.html returned response 404 Not Found'.
It seems that writing a function to check for new version of the PWA has cleaned up everything. Because it's a PWA, when replacing files with a new version -- the cache will still be there and shift+reloading won't necessarily clear it, causing a lot of unwanted behaviour.
The code for the cleanup looks like this:
First, inject in the constructor the following: updates: SwUpdate
import { SwUpdate } from "#angular/service-worker"
Then, inside ngOnInit, I have the following:
updates.available.subscribe(event => {
updates.activateUpdate().then(() => document.location.reload());
})
It will force a complete refresh 2-3 seconds in if there's a new version available but all works well afterwards.

chrome.webstore.install() failure detail string error codes?

I can't seem to find the failure detail string error codes for chrome.webstore.install() 's failure callback... For that matter, I'm not sure if there's documentation for this part of Chrome app development??
From https://developers.google.com/chrome/web-store/docs/inline_installation#triggering
This function [the failure callback] is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site. The callback is given a failure detail string as a parameter. You may wish to inspect or log that string for debugging purposes, but you should not rely on specific strings being passed back.