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

Error: Cookie has domain set to the public suffix "localhost" which is a special use domain. #587

Open
kennsippell opened this issue Nov 20, 2023 · 2 comments
Labels
Type: Bug Fix something that isn't working as intended

Comments

@kennsippell
Copy link
Member

kennsippell commented Nov 20, 2023

Describe the bug
Its a crash

To Reproduce

  1. npx cht --local

Expected behavior
Should be able to deploy locally

Logs

INFO Starting action: backup-all-forms… 
INFO Error: Cookie has domain set to the public suffix "localhost" which is a special use domain. To allow this, configure your CookieJar with {allowSpecialUseDomain:true, rejectPublicSuffixes: false}.
    at Object.getPublicSuffix (/home/kenn/config-echis-2.0/node_modules/tough-cookie/lib/pubsuffix-psl.js:62:11)
    at permuteDomain (/home/kenn/config-echis-2.0/node_modules/tough-cookie/lib/permuteDomain.js:38:28)
    at MemoryCookieStore.findCookies (/home/kenn/config-echis-2.0/node_modules/tough-cookie/lib/memstore.js:99:21)
    at MemoryCookieStore.findCookies (/home/kenn/config-echis-2.0/node_modules/universalify/index.js:5:67)
    at CookieJar.getCookies (/home/kenn/config-echis-2.0/node_modules/tough-cookie/lib/cookie.js:1410:11)
    at CookieJar.getCookies (/home/kenn/config-echis-2.0/node_modules/universalify/index.js:5:67)
    at CookieJar.getCookieString (/home/kenn/config-echis-2.0/node_modules/tough-cookie/lib/cookie.js:1455:21)
    at CookieJar.getCookieString (/home/kenn/config-echis-2.0/node_modules/universalify/index.js:5:67)
    at node:internal/util:364:7
    at new Promise (<anonymous>)
    at bound getCookieString (node:internal/util:350:12)
    at fetchCookie (/home/kenn/config-echis-2.0/node_modules/fetch-cookie/index.js:15:26)
    at ourFetch (/home/kenn/config-echis-2.0/node_modules/pouchdb-adapter-http/lib/index.js:218:12)
    at fetchJSON (/home/kenn/config-echis-2.0/node_modules/pouchdb-adapter-http/lib/index.js:246:12)
    at setup (/home/kenn/config-echis-2.0/node_modules/pouchdb-adapter-http/lib/index.js:294:20)
    at PouchDB.HttpPouch.api.fetch (/home/kenn/config-echis-2.0/node_modules/pouchdb-adapter-http/lib/index.js:467:12) 
ERROR Cookie has domain set to the public suffix "localhost" which is a special use domain. To allow this, configure your CookieJar with {allowSpecialUseDomain:true, rejectPublicSuffixes: false}. 

Environment

  • Instance: localhost
  • Client platform: Ubuntu
  • export COUCH_URL=http://medic:pwd@localhost:6984/medic
  • cht-conf version: 3.18.3
  • cht-core version: 4.4

Additional context
Kenya eCHIS local testing

@kennsippell kennsippell added the Type: Bug Fix something that isn't working as intended label Nov 20, 2023
@kennsippell
Copy link
Member Author

kennsippell commented Nov 20, 2023

Workaround is to use 127.0.0.1 instead of localhost

@kennsippell
Copy link
Member Author

Also manifests as

INFO Error: Unable to fetch xml attachment of doc with id xxx, returned status code = undefined
    at Object.preUploadForm (/home/kenn/config-echis-2.0/node_modules/cht-conf/src/lib/warn-upload-overwrite.js:199:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async execute (/home/kenn/config-echis-2.0/node_modules/cht-conf/src/lib/upload-forms.js:91:21)
    at async module.exports (/home/kenn/config-echis-2.0/node_modules/cht-conf/src/lib/main.js:193:5)
    at async /home/kenn/config-echis-2.0/node_modules/cht-conf/src/bin/index.js:16:5 

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