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

API logs error when privacy policies doc contains no privacy policies #9527

Open
dianabarsan opened this issue Oct 11, 2024 · 0 comments
Open
Labels
Type: Bug Fix something that isn't working as intended

Comments

@dianabarsan
Copy link
Member

Describe the bug
When the privacy policies doc lacks the privacy_policies property, API logs an error. However this error is not critical and does not inform the user of what they should do.
An empty privacy policies doc can come from an incomplete, but not incorrect configuration.

This creates noise and confusion, and gets reported as the reason why API crashed.

To Reproduce
Steps to reproduce the behavior:

  1. In your config folder, create a privacy-policies.json file, but leave it empty.
  2. Upload thid config.
  3. Relaunch API.
  4. See error

Expected behavior
This should be logged as a warning, or inform the user on what to do.

Logs

2024-10-11T08:30:29.645 ERROR: Error retrieving privacy policies: Error: Invalid privacy-policies doc: missing required "privacy_policies" property
    at /service/api/src/services/privacy-policy.js:25:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 3)
    at async getLoginPageContents (/service/api/src/generate-service-worker.js:53:10)
    at async writeServiceWorkerFile (/service/api/src/generate-service-worker.js:101:23)
    at async Object.run (/service/api/src/generate-service-worker.js:154:5)
    at async /service/api/server.js:91:5 {
  [stack]: 'Error: Invalid privacy-policies doc: missing required "privacy_policies" property\n' +
    '    at /service/api/src/services/privacy-policy.js:25:15\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
    '    at async Promise.all (index 3)\n' +
    '    at async getLoginPageContents (/service/api/src/generate-service-worker.js:53:10)\n' +
    '    at async writeServiceWorkerFile (/service/api/src/generate-service-worker.js:101:23)\n' +
    '    at async Object.run (/service/api/src/generate-service-worker.js:154:5)\n' +
    '    at async /service/api/server.js:91:5',
  [message]: 'Invalid privacy-policies doc: missing required "privacy_policies" property'
} 

Environment

  • App: api
  • Version: 4.0.0
@dianabarsan dianabarsan added the Type: Bug Fix something that isn't working as intended label Oct 11, 2024
@dianabarsan dianabarsan changed the title API logs error when privacy policies doc is malformed API logs error when privacy policies doc contains no privacy policies Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix something that isn't working as intended
Projects
None yet
Development

No branches or pull requests

1 participant