AceCentre / aacnews

This is a small nodejs based app that manages public submissions of short news items that then gets published using a mailchimp campaign. An example of this is AACNews Monthly, managed by the Ace Centre.
https://aacinfo.email
1 stars 3 forks source link

posts dropdown stops appearing #33

Closed willwade closed 4 years ago

willwade commented 6 years ago

No error log I can find for this.. But occasionally I get a call to say the posts screen doesn't work. (i.e. /posts ) In particular the dropdown isn't populating.

No idea why.. But restarting app fixes it.

hosseinzoda commented 6 years ago

Apparently works in my browser. (Firefox 58) Need to catch the event which this happens. screenshot from 2018-01-10 16-04-49

willwade commented 6 years ago

There is still a residual bug - but server is restarting - cant figure out what/where this is - full logs below..

`5|aacinfo | Error: Can't set headers after they are sent. 5|aacinfo | at validateHeader (_http_outgoing.js:494:11) 5|aacinfo | at ServerResponse.setHeader (_http_outgoing.js:501:3) 5|aacinfo | at ServerResponse.res.set.res.header (/srv/aacinfo/node_modules/express/lib/response.js:530:10) 5|aacinfo | at ServerResponse.res.json (/srv/aacinfo/node_modules/express/lib/response.js:190:36) 5|aacinfo | at /srv/aacinfo/controllers/posts.js:148:13 5|aacinfo | at /srv/aacinfo/node_modules/mongoose/lib/query.js:2313:18 5|aacinfo | at tryCatcher (/srv/aacinfo/node_modules/bluebird/js/release/util.js:16:23) 5|aacinfo | at Promise._settlePromiseFromHandler (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:510:31) 5|aacinfo | at Promise._settlePromise (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:567:18) 5|aacinfo | at Promise._settlePromise0 (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:612:10) 5|aacinfo | at Promise._settlePromises (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:691:18) 5|aacinfo | at Async._drainQueue (/srv/aacinfo/node_modules/bluebird/js/release/async.js:138:16) 5|aacinfo | at Async._drainQueues (/srv/aacinfo/node_modules/bluebird/js/release/async.js:148:10) 5|aacinfo | at Immediate.Async.drainQueues (/srv/aacinfo/node_modules/bluebird/js/release/async.js:17:14) 5|aacinfo | at runCallback (timers.js:789:20) 5|aacinfo | at tryOnImmediate (timers.js:751:5) 5|aacinfo | at processImmediate [as _immediateCallback] (timers.js:722:5) 5|aacinfo | Error: Can't set headers after they are sent. 5|aacinfo | at validateHeader (_http_outgoing.js:494:11) 5|aacinfo | at ServerResponse.setHeader (_http_outgoing.js:501:3) 5|aacinfo | at ServerResponse.res.set.res.header (/srv/aacinfo/node_modules/express/lib/response.js:530:10) 5|aacinfo | at ServerResponse.res.json (/srv/aacinfo/node_modules/express/lib/response.js:190:36) 5|aacinfo | at /srv/aacinfo/controllers/posts.js:148:13 5|aacinfo | at /srv/aacinfo/node_modules/mongoose/lib/query.js:2313:18 5|aacinfo | at tryCatcher (/srv/aacinfo/node_modules/bluebird/js/release/util.js:16:23) 5|aacinfo | at Promise._settlePromiseFromHandler (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:510:31) 5|aacinfo | at Promise._settlePromise (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:567:18) 5|aacinfo | at Promise._settlePromise0 (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:612:10) 5|aacinfo | at Promise._settlePromises (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:691:18) 5|aacinfo | at Async._drainQueue (/srv/aacinfo/node_modules/bluebird/js/release/async.js:138:16) 5|aacinfo | at Async._drainQueues (/srv/aacinfo/node_modules/bluebird/js/release/async.js:148:10) 5|aacinfo | at Immediate.Async.drainQueues (/srv/aacinfo/node_modules/bluebird/js/release/async.js:17:14) 5|aacinfo | at runCallback (timers.js:789:20) 5|aacinfo | at tryOnImmediate (timers.js:751:5) 5|aacinfo | at processImmediate [as _immediateCallback] (timers.js:722:5)

/home/nodejs/.pm2/logs/aacinfo-out.log last 1000 lines: 5|aacinfo | Listening on port 8081 5|aacinfo | aPost 5|aacinfo | { title: 'Smyle Mouse', 5|aacinfo | text: 'Smyle Mouse software is the next-generation in head mouse technology. It includes a head pointer, smile clicker, and a dwell clicker. You can use it as a powerful head mouse or as a novel access method where your smile acts as a switch. Available from Tobii Dynavox', 5|aacinfo | type: '5502a0c712345e9402000005', 5|aacinfo | link: 'https://smylemouse.com/', 5|aacinfo | _id: 5a6f3e51a3c01919a93628d2, 5|aacinfo | author: '@acecentre', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-11-01T00:00:00.000Z } 5|aacinfo | req.params.post_id: 5a57704e3387f25d1f0ee6b3 5|aacinfo | postHistory 5|aacinfo | null 5|aacinfo | null 5|aacinfo | aPost 5|aacinfo | { title: 'VocalID in the Guardian', 5|aacinfo | text: 'The Guardian have written an article around VocalID', 5|aacinfo | type: '5502a0c712345e9402000005', 5|aacinfo | link: 'https://www.theguardian.com/news/2018/jan/23/voice-replacement-technology-adaptive-alternative-communication-vocalid', 5|aacinfo | _id: 5a6f3e94a3c01919a93628d4, 5|aacinfo | author: '@acecentre', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-01-29T15:32:36.097Z } 5|aacinfo | req.params.post_id: 5a66fc1927d7056b33218fe9 5|aacinfo | postHistory 5|aacinfo | null 5|aacinfo | null 5|aacinfo | aPost 5|aacinfo | { title: 'Dyslexia Support', 5|aacinfo | text: 'Nessy is an online tool based around games to support children with dyslexia. On their website they have a free e-book about dyslexia and a free dyslexia test.', 5|aacinfo | type: '5502a4e149afd68a02000002', 5|aacinfo | link: 'https://www.nessy.com/uk/resources/', 5|aacinfo | _id: 5a6f3f94a3c01919a93628d6, 5|aacinfo | author: '@acecentre', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-01-29T15:36:52.063Z } 5|aacinfo | req.params.post_id: 5a65e20a120d74368f73c163 5|aacinfo | postHistory 5|aacinfo | null 5|aacinfo | null 5|aacinfo | aPost 5|aacinfo | { title: 'Tobii Dynavox Core Words, AAC & Pathways Day', 5|aacinfo | text: 'Tobii Dynavox would like to invite you to a free day of learning about & getting hands on with our new AAC software, Snap + Core First & the ecosystem that we have created around it. Pathways is at the centre of the support system developed for both the person using AAC as well as their communication partners. We will also highlight resources such as Core First Learning & Boardmaker. Events all over the UK www.tobiidynavox.eventbrite.com', 5|aacinfo | type: '559a3b91e567b5d42000000b', 5|aacinfo | link: 'https://tobiidynavox.eventbrite.co.uk', 5|aacinfo | _id: 5a6f402da3c01919a93628d8, 5|aacinfo | author: 'tina.voizey@tobiidynavox.com', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-01-29T15:39:25.295Z } 5|aacinfo | req.params.post_id: 5a5f5d8f120d74368f73c15e 5|aacinfo | postHistory 5|aacinfo | null 5|aacinfo | null 5|aacinfo | aPost 5|aacinfo | { title: 'Tobii Dynavox Core First & Pathways Day', 5|aacinfo | text: 'Tobii Dynavox are providing a free day about Snap with Core First & the supportive app Pathways. We will also highlight resources such as Core First Learning & Board maker. Book on here; www.tobiidynavox.eventbrite.com', 5|aacinfo | type: '559a3b91e567b5d42000000b', 5|aacinfo | link: 'https://tobiidynavox.eventbrite.co.uk', 5|aacinfo | _id: 5a6f4378a3c01919a93628da, 5|aacinfo | author: 'tina.voizey@tobiidynavox.com', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-01-29T15:53:28.137Z } 5|aacinfo | req.params.post_id: 5a5f5d8f120d74368f73c15e 5|aacinfo | postHistory 5|aacinfo | { _id: 5a6f402da3c01919a93628d9, 5|aacinfo | id_post: '5a5f5d8f120d74368f73c15e', 5|aacinfo | title: 'FREE Tobii Dynavox Core Words, AAC & Pathways Day', 5|aacinfo | text: 'Tobii Dynavox would like to invite you to a free day of learning about & getting hands on with our new AAC software, Snap + Core First & the ecosystem that we have created around it. Pathways is at the centre of the support system developed for both the person using AAC as well as their communication partners. We will also highlight resources such as Core First Learning & Boardmaker. Events all over the UK www.tobiidynavox.eventbrite.com', 5|aacinfo | type: '559a3b91e567b5d42000000b', 5|aacinfo | __v: 0, 5|aacinfo | date_creation: 2018-01-29T15:39:25.308Z, 5|aacinfo | version: 1, 5|aacinfo | author: 'tina.voizey@tobiidynavox.com', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | link: 'https://tobiidynavox.eventbrite.co.uk', 5|aacinfo | date: 2018-01-17T00:00:00.000Z } 5|aacinfo | null 5|aacinfo | aPost 5|aacinfo | { title: 'Modular hose mounting solutions', 5|aacinfo | text: 'A compamy based in the United States are selling loc-line based mounting products for Assistive Technology.', 5|aacinfo | type: '5502a0c712345e9402000005', 5|aacinfo | link: 'http://www.assistive.solutions/products/', 5|aacinfo | _id: 5a6f441aa3c01919a93628dc, 5|aacinfo | author: '@acecentre', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-01-29T15:56:10.538Z } 5|aacinfo | req.params.post_id: 5a5f854b120d74368f73c160 5|aacinfo | postHistory 5|aacinfo | null 5|aacinfo | null 5|aacinfo | aPost 5|aacinfo | { title: 'Core First printable communication boards', 5|aacinfo | text: 'Printable PDF files of Core First core vocabulary pages are available free. Editable versions are also available at Boardmaker Online.', 5|aacinfo | type: '5502a04412345e9402000002', 5|aacinfo | link: 'https://www.tobiidynavox.com/en-GB/support-training/downloads/snap/printable-core-first-communication-boards/?MarketPopupClicked=true', 5|aacinfo | _id: 5a6f448ba3c01919a93628de, 5|aacinfo | author: '@acecentre', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-01-29T15:58:03.406Z } 5|aacinfo | req.params.post_id: 5a5c8c873387f25d1f0ee6ba 5|aacinfo | postHistory 5|aacinfo | null 5|aacinfo | null 5|aacinfo | aPost 5|aacinfo | { title: 'MMU - Research Fellow (Communication Disability)', 5|aacinfo | text: 'Research fellowship at MMU. "post requires applicants to hold a PhD and have a particular focus on research related to Augmentative and Alternative Communication (AAC) in children or adults with developmental, lifespan or acquired communication disability."', 5|aacinfo | type: '5502a4d649afd68a02000001', 5|aacinfo | link: 'https://manmetjobs.mmu.ac.uk/jobs/vacancy/research-fellow-communication-disability-0299-mmu-birley-campus/316/description/', 5|aacinfo | _id: 5a6f452ea3c01919a93628e0, 5|aacinfo | author: '@acecentre', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-01-29T16:00:46.718Z } 5|aacinfo | req.params.post_id: 5a5b706c3387f25d1f0ee6b8 5|aacinfo | postHistory 5|aacinfo | null 5|aacinfo | null 5|aacinfo | aPost 5|aacinfo | { title: 'Celebrities help girl get her voice back', 5|aacinfo | text: '“Miya Thirlby, 16 from Plymouth, has cerebral palsy, epilepsy and is deaf. She uses an adapted computer which helps her speak.\nHer dad, Paul Johnson took to Twitter to appeal for its return after the machine was stolen from his car.”', 5|aacinfo | type: '5502a53a49afd68a02000003', 5|aacinfo | link: 'http://www.bbc.co.uk/news/uk-england-devon-42610496', 5|aacinfo | _id: 5a6f45d4a3c01919a93628e2, 5|aacinfo | author: '@acecentre', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-12-01T00:00:00.000Z } 5|aacinfo | req.params.post_id: 5a588cce3387f25d1f0ee6b6 5|aacinfo | postHistory 5|aacinfo | null 5|aacinfo | null 5|aacinfo | Listening on port 8081 5|aacinfo | aPost 5|aacinfo | { title: 'Smyle Mouse', 5|aacinfo | text: 'Smyle Mouse software is a new head mouse. It includes a head pointer, smile clicker (smile acts as a switch) and a dwell clicker. Available from Tobii Dynavox.', 5|aacinfo | type: '5502a0c712345e9402000005', 5|aacinfo | link: 'https://smylemouse.com/', 5|aacinfo | _id: 5a6f474b167f8d55186d9595, 5|aacinfo | author: '@acecentre', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | date: 2018-11-01T00:00:00.000Z } 5|aacinfo | req.params.post_id: 5a57704e3387f25d1f0ee6b3 5|aacinfo | postHistory 5|aacinfo | { _id: 5a6f3e51a3c01919a93628d3, 5|aacinfo | id_post: '5a57704e3387f25d1f0ee6b3', 5|aacinfo | title: 'Smyle Mouse', 5|aacinfo | text: 'Smyle Mouse software is the next-generation in head mouse technology. It includes a head pointer, smile clicker, and a dwell clicker. You can use it as a powerful head mouse or as a novel access method where your smile acts as a switch. Available from Tobii Dynavox', 5|aacinfo | type: '5502a0c712345e9402000005', 5|aacinfo | __v: 0, 5|aacinfo | date_creation: 2018-01-29T15:31:29.963Z, 5|aacinfo | version: 1, 5|aacinfo | author: 'Simon Bull', 5|aacinfo | priority: '0', 5|aacinfo | promoted: 0, 5|aacinfo | published: 0, 5|aacinfo | link: 'https://smylemouse.com/', 5|aacinfo | date: 2018-01-11T00:00:00.000Z } 5|aacinfo | null `

hosseinzoda commented 6 years ago

I get "Not authorized" for http://aacinfo.net/api/posts. Maybe that's why i don't see the issue.

willwade commented 6 years ago

Ok - went on today and happened again. This was the logs that I could get..

/home/nodejs/.pm2/logs/aacinfo-error.log last 15 lines: at ServerResponse.res.set.res.header (/srv/aacinfo/node_modules/express/lib/response.js:530:10) at ServerResponse.res.json (/srv/aacinfo/node_modules/express/lib/response.js:190:36) at /srv/aacinfo/controllers/posts.js:148:13 at /srv/aacinfo/node_modules/mongoose/lib/query.js:2313:18 at tryCatcher (/srv/aacinfo/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:510:31) at Promise._settlePromise (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:567:18) at Promise._settlePromise0 (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:612:10) at Promise._settlePromises (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:691:18) at Async._drainQueue (/srv/aacinfo/node_modules/bluebird/js/release/async.js:138:16) at Async._drainQueues (/srv/aacinfo/node_modules/bluebird/js/release/async.js:148:10) at Immediate.Async.drainQueues (/srv/aacinfo/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:789:20) at tryOnImmediate (timers.js:751:5) at processImmediate [as _immediateCallback] (timers.js:722:5)

/home/nodejs/.pm2/logs/aacinfo-out.log last 15 lines: https://www.youtube.com/watch?v=SR7CgRyqxI0&t=2s callbacking 2 Entradno em SAVE link callbacking null All posts have been processed successfully Listening on port 8081 Listening on port 8081 Entradno em SAVE posts https://archive.org/details/mrsymbolman callbacking 2 Entradno em SAVE link callbacking null Listening on port 8081