Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STIGMAN.serializeError is not a function #1446

Open
3 of 7 tasks
ltran10914 opened this issue Dec 10, 2024 · 5 comments
Open
3 of 7 tasks

STIGMAN.serializeError is not a function #1446

ltran10914 opened this issue Dec 10, 2024 · 5 comments

Comments

@ltran10914
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Are you using the latest version of STIG Manager?

  • I am using the latest Release.
  • I am NOT using the latest Release. I am aware that the first thing I will be asked to do is update the application so that I have the latest bugfixes.

Where are you experiencing the issue?

  • API
  • UI or other client
  • Deployment
  • Elsewhere

Current Behavior

Create collection >> import checklists >> Open checklist >> attempt to edit any key's status from NR to NF >> Error come up displaying "STIGMAN.serializedError is not a function" and not allow to modify STIG checklist.

KeyCloak running events:
2024-12-10 14:23:04,627 WARN [org.keycloak.protocol.oidc.utils.AcrUtils] (executor-thread-7) Invalid realm configuration (ACR-LOA map)
2024-12-10 14:24:06,987 WARN [org.keycloak.protocol.oidc.utils.AcrUtils] (executor-thread-7) Invalid realm configuration (ACR-LOA map)

STIG Manager running event:
{"date":"2024-12-10T19:26:22.840Z","level":3,"component":"rest","type":"transaction","data":{"request":{"date":"2024-12-10T19:26:11.273Z","source":"::ffff:157.141.252.200","method":"PUT","url":"/api/collections/91/reviews/30628/SV-235758r961683_rule?projection=history","headers":{"host":"snnsvr002.nnsy.sy:54000","connection":"keep-alive","content-length":"462","sec-ch-ua-platform":""Windows"","x-requested-with":"XMLHttpRequest","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","sec-ch-ua":""Microsoft Edge";v="131", "Chromium";v="131", "Not_A Brand";v="24"","content-type":"application/json;charset=UTF-8","sec-ch-ua-mobile":"?0","accept":"/","origin":"http://snnsvr002.nnsy.sy:54000","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://snnsvr002.nnsy.sy:54000/","accept-language":"en-US,en;q=0.9","x-forwarded-for":"157.141.7.61","accessToken":{"exp":1733858946,"iat":1733858646,"auth_time":1733857813,"jti":"2513f5f0-f5e6-4d28-a4aa-a0ef096be3da","iss":"http://snnsvr002.nnsy.sy:8080/realms/stigman","aud":"account","sub":"0b87dc44-082b-4f49-90ca-8f2bef5c0799","typ":"Bearer","azp":"stig-manager","nonce":"682fc429-2c4b-4335-a36c-5d0ce215f557","session_state":"359a00bf-4b3a-42d2-9e6a-67b05c7c21ed","acr":"1","allowed-origins":["*","http://*","https://*","https://nnsyapps.nnsy.navy.mil"],"realm_access":{"roles":["offline_access","create_collection","default-roles-stigman","admin","uma_authorization","user"]},"resource_access":{"account":{"roles":["manage-account","manage-account-links","view-profile"]}},"scope":"email stig-manager:op stig-manager:user stig-manager:stig:read stig-manager:user:read stig-manager:stig stig-manager:collection profile","sid":"359a00bf-4b3a-42d2-9e6a-67b05c7c21ed","email_verified":true,"name":"Lac Tran Admin","preferred_username":"nn093696sa","given_name":"Lac Tran","family_name":"Admin"},"authorization":true}},"response":{"date":"2024-12-10T19:26:22.839Z","status":500,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"958","etag":"W/"3be-EC0l0v+B/ZzAsF35S7l5OKSr0p4"","vary":"Accept-Encoding"},"errorBody":{"error":"Duplicate entry '2147483647' for key 'review_history.PRIMARY'","stack":"Error: Duplicate entry '2147483647' for key 'review_history.PRIMARY'\n at PromisePoolConnection.query (C:\Program Files\stig-manager-main\api\source\node_modules\mysql2\promise.js:93:22)\n at transaction (C:\Program Files\stig-manager-main\api\source\service\ReviewService.js:1292:28)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async retryFunction (C:\Program Files\stig-manager-main\api\source\service\utils.js:457:14)\n at async module.exports.retryOnDeadlock (C:\Program Files\stig-manager-main\api\source\service\utils.js:467:10)\n at async exports.putReviewsByAsset (C:\Program Files\stig-manager-main\api\source\service\ReviewService.js:1302:5)\n at async module.exports.putReviewByAssetRule (C:\Program Files\stig-manager-main\api\source\controllers\Review.js:151:20)"}},"retries":0,"durationMs":11566}

Expected Behavior

Able to edit checklist status.

Steps To Reproduce

  1. logon to STIG Manager with Admin role
  2. Create collection
  3. Import checklists
  4. Open checklist
  5. change status of any Key from NR to NF -Error comes up

Can you provide screenshots, logs, or other useful artifacts?

stigman-serializeError not a function

Describe your Environment

- Hosting: KeyCloak
- Browser: Edge
- OS: Windows Serve 2022
- Node: 22.4.1
- npm: python 3.12.6

Any assistance is greatly appreciated.
@cd-rite
Copy link
Collaborator

cd-rite commented Dec 10, 2024

Hi @ltran10914 It looks like you're reaching the maximum value for history Ids in the system, which are stored in an integer column in the database. This is quite surprising to me, as it implies you've created well over 2 billion history records!
We don't have an immediate solution for this, but some more information may help us come up with one:
What version of STIG Manager are you using?
If you are using version 1.4.16 or later, can you provide the Application Info report available for download from the app here:

image

You could attach it to this issue if you are comfortable, or email it to: [email protected]

In the meantime, one workaround would be to change your Review History setting to "disabled" for each of your Collections. This will obviously turn off history for your Collections, but should let your updates succeed.

image

@ltran10914
Copy link
Author

I attempted to disable the reviewed history for all of my collections but still getting the same error when re-tried to modify the STIG keys.

When I tried to export the Application info, but I get this continuous spinning of "Waiting for JSON" not sure if I was supposed to wait until it complete. It doesn't seem to do anything afterward. Attaching screenshot.

I am a bit confuse as to what version of STIG manager I am currently using. I recalled that we deployed STIG Manager 1.0.42 version source file, but it displays 1.4.2 on the GUI web console and the running event from the CMD listed as 1.4.2. Attaching screenshots. The release-notes.rst file are also attached.
release-notes.txt

STIG Manager Startup Running Events:

{"date":"2024-12-11T14:53:58.564Z","level":3,"component":"index","type":"starting","data":{"version":"1.4.2","env":{"STIGMAN_CLIENT_DIRECTORY":"..\..\client\src","STIGMAN_DB_PASSWORD":"*","STIGMAN_OIDC_PROVIDER":"http://snnsvr002.nnsy.sy:8080/realms/stigman"},"dirname":"C:\\Program Files\stig-manager-main\api\source","cwd":"C:\Program Files\stig-manager-main\api\source"}}
{"date":"2024-12-11T14:53:58.574Z","level":3,"component":"index","type":"configuration","data":{"version":"1.4.2","commit":{"branch":"na","sha":"na","tag":"na","describe":"na"},"settings":{"lastAccessResolution":60,"responseValidation":"none"},"client":{"clientId":"stig-manager","authority":"http://snnsvr002.nnsy.sy:8080/realms/stigman","apiBase":"api","disabled":false,"directory":"..\\..\\client\\src","refreshToken":{"disabled":false},"welcome":{"image":"","message":"","title":"","link":""}},"docs":{"disabled":false,"docsDirectory":"../../docs/_build/html"},"http":{"address":"0.0.0.0","port":54000,"maxJsonBody":"31457280","maxUpload":"1073741824"},"database":{"host":"localhost","port":3306,"schema":"stigman","username":"stigman","maxConnections":25,"tls":{},"revert":false,"password":true},"swaggerUi":{"enabled":false,"authority":"http://snnsvr002.nnsy.sy:8080/realms/stigman","server":"http://localhost:54000/api","oauth2RedirectUrl":"http://localhost:54000/api-docs/oauth2-redirect.html"},"oauth":{"authority":"http://snnsvr002.nnsy.sy:8080/realms/stigman","claims":{"scope":"scope","name":"name","privileges":"['realm_access']?.['roles']","email":"email"}},"log":{"level":3,"mode":"combined"}}}
{"date":"2024-12-11T14:53:59.749Z","level":3,"component":"oidc","type":"discovery","data":{"success":true,"metadataUri":"http://snnsvr002.nnsy.sy:8080/realms/stigman/.well-known/openid-configuration","jwksUri":"http://snnsvr002.nnsy.sy:8080/realms/stigman/protocol/openid-connect/certs"}}
{"date":"2024-12-11T14:54:00.112Z","level":3,"component":"mysql","type":"preflight","data":{"success":true,"version":"8.0.36"}}
{"date":"2024-12-11T14:54:01.749Z","level":3,"component":"mysql","type":"migration","data":{"message":"MySQL schema is up to date"}}
{"date":"2024-12-11T14:54:01.753Z","level":1,"component":"app","type":"uncaught","data":{"code":"EADDRINUSE","errno":-4091,"syscall":"listen","address":"::","port":54000,"name":"Error","message":"listen EADDRINUSE: address already in use :::54000","stack":"Error: listen EADDRINUSE: address already in use :::54000\n at Server.setupListenHandle [as _listen2] (node:net:1904:16)\n at listenInCluster (node:net:1961:12)\n at Server.listen (node:net:2063:7)\n at startServer (C:\Program Files\stig-manager-main\api\source\index.js:242:43)"}}
Export Application Info Error
STIG Manager Startup -Version - SNIPIT

@cd-rite
Copy link
Collaborator

cd-rite commented Dec 11, 2024

Ah, ok. That version (1.4.2) is fairly old and does not have our latest Application Info report. The button you pushed was actually trying to download a copy of all your data, which would definitely fail with that large a data set (Hence the "experimental" flag).

You are in a bit of a bind here...
If you don't need your Review History, and are familiar with MySQL, you could truncate the review_history table. You'd need access to the DB and either the MySQL CLI or a tool like MySQL Workbench.
(Make sure you have a backup, first!!!!)
TRUNCATE stigman.review_history;

Alternatively, you could export archives of each of your Collections (from the Manage Collection interface), and then import the files into a new Instance. Those archives don't carry history, so you'd be starting fresh with the current state of your results.
This might be a slightly less nuclear option than blowing away the review_history table, but could be tedious.

In the meantime, we will look at a change to the review_history table to allow bigger ids, but that will require an app update and won't help you in the near future.

@ltran10914
Copy link
Author

Ah, ok. That version (1.4.2) is fairly old and does not have our latest Application Info report. The button you pushed was actually trying to download a copy of all your data, which would definitely fail with that large a data set (Hence the "experimental" flag).

You are in a bit of a bind here... If you don't need your Review History, and are familiar with MySQL, you could truncate the review_history table. You'd need access to the DB and either the MySQL CLI or a tool like MySQL Workbench. (Make sure you have a backup, first!!!!) TRUNCATE stigman.review_history;

Alternatively, you could export archives of each of your Collections (from the Manage Collection interface), and then import the files into a new Instance. Those archives don't carry history, so you'd be starting fresh with the current state of your results. This might be a slightly less nuclear option than blowing away the review_history table, but could be tedious.

In the meantime, we will look at a change to the review_history table to allow bigger ids, but that will require an app update and won't help you in the near future.

I remove all of my collection and recreate a blank one to import new checklist. I am still not able to modify the checklist v-key status. Still getting the error. Attaching STIG manager running event log.

STIG_manager-running event file with error even after all collections are deleted.txt

@cd-rite
Copy link
Collaborator

cd-rite commented Dec 13, 2024

Hi @ltran10914 I meant an entirely new instance of STIG Manager, not a new Collection.
If that is not feasible, truncating the review_history table may be your only option.
We will release an update that will allow more history to be created, but that likely won't happen until the new year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants