Hi @ViliusZigmantas and @ibuchanan I want to thank you both for helping me out.
To answer your questions @ViliusZigmantas first:
-
I was running an old version of ACE but I have now upgraded to the latest with no change
-
There is no POST route custom code the only custom route codes are GET.
-
Sending POST to /installed using Postman gives the same result (503)
-
External routing is open since I can GET /atlassian-connect.json
-
Heroku sets the PORT environmental variability automatically and I can verify it.
-
When installing the Postgres service in Heroku, Heroku sets a $DATABASE_URL with correct credentials which I have verified.
Thank you as well for the suggestions of using Atlassian Connect Inspector, I knew of it I just somehow had not connected the dots on the usefulness of it.
@ibuchanan Thank you for the suggestion of trying to log/trap the transaction. I have tried a lot to get it to work. The best I got was by creating a server.post route in routes.js that logged out the call. By doing so I however broke the app as this interfered apparently with the ACE routing. Following is the body of the req that was logged:
body: {
key: 'bug-consolidator-for-jira-heroku',
clientKey: '4c72d0bb-d200-332f-8d42-6e7b66f88ccb',
publicKey: 'MIGf... "Center part removed for privacy" ...AQAB',
sharedSecret: 'L1BD... "Center part removed for privacy" ...OLzA',
serverVersion: '100167',
pluginsVersion: '1001.0.0-SNAPSHOT',
baseUrl: 'https://hiproject.atlassian.net',
productType: 'jira',
description: 'Atlassian JIRA at https://hiproject.atlassian.net ',
eventType: 'installed'
},
I see nothing wrong with it. it´s exactly the same as is logged when I install the app in dev mode. See below:
body: {
key: 'bug-consolidator-for-jira',
clientKey: '4c72... "Center part removed for privacy" ...8ccb',
publicKey: 'MIGf... "Center part removed for privacy" ...AQAB',
sharedSecret: 'pmI1... "Center part removed for privacy" ...k2Pg',
serverVersion: '100166',
pluginsVersion: '1001.0.0-SNAPSHOT',
baseUrl: 'https://hiproject.atlassian.net',
productType: 'jira',
description: 'Atlassian JIRA at https://hiproject.atlassian.net ',
eventType: 'installed'
}
Following is the full req that I logged.
{
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: true,
ended: true,
endEmitted: true,
reading: false,
sync: false,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: true,
autoDestroy: false,
destroyed: false,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: false
},
_events: [Object: null prototype] { end: [Function: clearRequestTimeout] },
_eventsCount: 1,
_maxListeners: undefined,
socket: <ref *1> Socket {
connecting: false,
_hadError: false,
_parent: null,
_host: null,
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: true,
ended: false,
endEmitted: false,
reading: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: false,
autoDestroy: false,
destroyed: false,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: false
},
_events: [Object: null prototype] {
end: [Array],
timeout: [Function: socketOnTimeout],
data: [Function: bound socketOnData],
error: [Array],
close: [Array],
drain: [Function: bound socketOnDrain],
resume: [Function: onSocketResume],
pause: [Function: onSocketPause]
},
_eventsCount: 8,
_maxListeners: undefined,
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
buffered: [],
bufferedIndex: 0,
allBuffers: true,
allNoop: true,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
emitClose: false,
autoDestroy: false,
errored: null,
closed: false,
closeEmitted: false
},
allowHalfOpen: true,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: Server {
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_connections: 1,
_handle: [TCP],
_usingWorkers: false,
_workers: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 0,
keepAliveTimeout: 5000,
maxHeadersCount: null,
headersTimeout: 60000,
requestTimeout: 0,
_connectionKey: '6::::16988',
[Symbol(IncomingMessage)]: [Function: IncomingMessage],
[Symbol(ServerResponse)]: [Function: ServerResponse],
[Symbol(kCapture)]: false,
[Symbol(async_id_symbol)]: 9
},
_server: Server {
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_connections: 1,
_handle: [TCP],
_usingWorkers: false,
_workers: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 0,
keepAliveTimeout: 5000,
maxHeadersCount: null,
headersTimeout: 60000,
requestTimeout: 0,
_connectionKey: '6::::16988',
[Symbol(IncomingMessage)]: [Function: IncomingMessage],
[Symbol(ServerResponse)]: [Function: ServerResponse],
[Symbol(kCapture)]: false,
[Symbol(async_id_symbol)]: 9
},
parser: HTTPParser {
'0': [Function: bound setRequestTimeout],
'1': [Function: parserOnHeaders],
'2': [Function: parserOnHeadersComplete],
'3': [Function: parserOnBody],
'4': [Function: parserOnMessageComplete],
'5': [Function: bound onParserExecute],
'6': [Function: bound onParserTimeout],
_headers: [],
_url: '',
socket: [Circular *1],
incoming: [Circular *2],
outgoing: null,
maxHeaderPairs: 2000,
_consumed: true,
onIncoming: [Function: bound parserOnIncoming],
[Symbol(resource_symbol)]: [HTTPServerAsyncResource]
},
on: [Function: socketListenerWrap],
addListener: [Function: socketListenerWrap],
prependListener: [Function: socketListenerWrap],
_paused: false,
_httpMessage: ServerResponse {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: false,
socket: [Circular *1],
_header: null,
_keepAliveTimeout: 5000,
_onPendingData: [Function: bound updateOutgoingData],
_sent100: false,
_expect_continue: false,
req: [Circular *2],
locals: [Object],
_startAt: undefined,
_startTime: undefined,
writeHead: [Function: writeHead],
__onFinished: [Function],
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
_peername: { address: '::ffff:10.13.124.73', family: 'IPv6', port: 22969 },
[Symbol(async_id_symbol)]: 51,
[Symbol(kHandle)]: TCP {
reading: true,
onconnection: null,
_consumed: true,
[Symbol(owner_symbol)]: [Circular *1]
},
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(RequestTimeout)]: undefined
},
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: {
host: 'bcj.herokuapp.com',
connection: 'close',
authorization: 'JWT eyJ0... "Center part removed for privacy" ...PooU',
accept: '*/*',
'atlassian-connect-version': '1001.0.0-SNAPSHOT',
'content-type': 'application/json; charset=UTF-8',
'user-agent': 'Atlassian HttpClient unknown / JIRA-1001.0.0-SNAPSHOT (100167) / Atlassian-Connect/1001.0.0-SNAPSHOT',
'x-request-id': 'ca081213-9ca0-4b24-bdba-40d18d6da334',
'x-forwarded-for': '52.215.192.232',
'x-forwarded-proto': 'https',
'x-forwarded-port': '443',
via: '1.1 vegur',
'connect-time': '0',
'x-request-start': '1625157883730',
'total-route-time': '0',
'content-length': '646'
},
rawHeaders: [
'Host',
'bcj.herokuapp.com',
'Connection',
'close',
'Authorization',
'JWT eyJ0... "Center part removed for privacy" ...PooU',
'Accept',
'*/*',
'Atlassian-Connect-Version',
'1001.0.0-SNAPSHOT',
'Content-Type',
'application/json; charset=UTF-8',
'User-Agent',
'Atlassian HttpClient unknown / JIRA-1001.0.0-SNAPSHOT (100167) / Atlassian-Connect/1001.0.0-SNAPSHOT',
'X-Request-Id',
'ca081213-9ca0-4b24-bdba-40d18d6da334',
'X-Forwarded-For',
'52.215.192.232',
'X-Forwarded-Proto',
'https',
'X-Forwarded-Port',
'443',
'Via',
'1.1 vegur',
'Connect-Time',
'0',
'X-Request-Start',
'1625157883730',
'Total-Route-Time',
'0',
'Content-Length',
'646'
],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '/installed',
method: 'POST',
statusCode: null,
statusMessage: null,
client: <ref *1> Socket {
connecting: false,
_hadError: false,
_parent: null,
_host: null,
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: true,
ended: false,
endEmitted: false,
reading: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: false,
autoDestroy: false,
destroyed: false,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: false
},
_events: [Object: null prototype] {
end: [Array],
timeout: [Function: socketOnTimeout],
data: [Function: bound socketOnData],
error: [Array],
close: [Array],
drain: [Function: bound socketOnDrain],
resume: [Function: onSocketResume],
pause: [Function: onSocketPause]
},
_eventsCount: 8,
_maxListeners: undefined,
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
buffered: [],
bufferedIndex: 0,
allBuffers: true,
allNoop: true,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
emitClose: false,
autoDestroy: false,
errored: null,
closed: false,
closeEmitted: false
},
allowHalfOpen: true,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: Server {
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_connections: 1,
_handle: [TCP],
_usingWorkers: false,
_workers: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 0,
keepAliveTimeout: 5000,
maxHeadersCount: null,
headersTimeout: 60000,
requestTimeout: 0,
_connectionKey: '6::::16988',
[Symbol(IncomingMessage)]: [Function: IncomingMessage],
[Symbol(ServerResponse)]: [Function: ServerResponse],
[Symbol(kCapture)]: false,
[Symbol(async_id_symbol)]: 9
},
_server: Server {
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_connections: 1,
_handle: [TCP],
_usingWorkers: false,
_workers: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 0,
keepAliveTimeout: 5000,
maxHeadersCount: null,
headersTimeout: 60000,
requestTimeout: 0,
_connectionKey: '6::::16988',
[Symbol(IncomingMessage)]: [Function: IncomingMessage],
[Symbol(ServerResponse)]: [Function: ServerResponse],
[Symbol(kCapture)]: false,
[Symbol(async_id_symbol)]: 9
},
parser: HTTPParser {
'0': [Function: bound setRequestTimeout],
'1': [Function: parserOnHeaders],
'2': [Function: parserOnHeadersComplete],
'3': [Function: parserOnBody],
'4': [Function: parserOnMessageComplete],
'5': [Function: bound onParserExecute],
'6': [Function: bound onParserTimeout],
_headers: [],
_url: '',
socket: [Circular *1],
incoming: [Circular *2],
outgoing: null,
maxHeaderPairs: 2000,
_consumed: true,
onIncoming: [Function: bound parserOnIncoming],
[Symbol(resource_symbol)]: [HTTPServerAsyncResource]
},
on: [Function: socketListenerWrap],
addListener: [Function: socketListenerWrap],
prependListener: [Function: socketListenerWrap],
_paused: false,
_httpMessage: ServerResponse {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: false,
socket: [Circular *1],
_header: null,
_keepAliveTimeout: 5000,
_onPendingData: [Function: bound updateOutgoingData],
_sent100: false,
_expect_continue: false,
req: [Circular *2],
locals: [Object],
_startAt: undefined,
_startTime: undefined,
writeHead: [Function: writeHead],
__onFinished: [Function],
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
_peername: { address: '::ffff:10.13.124.73', family: 'IPv6', port: 22969 },
[Symbol(async_id_symbol)]: 51,
[Symbol(kHandle)]: TCP {
reading: true,
onconnection: null,
_consumed: true,
[Symbol(owner_symbol)]: [Circular *1]
},
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(RequestTimeout)]: undefined
},
_consuming: true,
_dumped: false,
next: [Function: next],
baseUrl: '',
originalUrl: '/installed',
_parsedUrl: Url {
protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: null,
query: null,
pathname: '/installed',
path: '/installed',
href: '/installed',
_raw: '/installed'
},
params: { '0': '/installed' },
query: {},
res: <ref *3> ServerResponse {
_events: [Object: null prototype] {
finish: [Array],
end: [Function: onevent]
},
_eventsCount: 2,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: false,
socket: <ref *1> Socket {
connecting: false,
_hadError: false,
_parent: null,
_host: null,
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 8,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: [Server],
_server: [Server],
parser: [HTTPParser],
on: [Function: socketListenerWrap],
addListener: [Function: socketListenerWrap],
prependListener: [Function: socketListenerWrap],
_paused: false,
_httpMessage: [Circular *3],
_peername: [Object],
[Symbol(async_id_symbol)]: 51,
[Symbol(kHandle)]: [TCP],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(RequestTimeout)]: undefined
},
_header: null,
_keepAliveTimeout: 5000,
_onPendingData: [Function: bound updateOutgoingData],
_sent100: false,
_expect_continue: false,
req: [Circular *2],
locals: {
title: 'Bug Consolidator for Jira Heroku',
addonKey: 'bug-consolidator-for-jira-heroku',
clientKey: '',
token: '',
license: undefined,
localBaseUrl: 'https://bcj.herokuapp.com',
hostBaseUrl: '',
hostUrl: '',
hostStylesheetUrl: '/atlassian-connect/all.css',
hostScriptUrl: 'https://connect-cdn.atl-paas.net/all.js'
},
_startAt: undefined,
_startTime: undefined,
writeHead: [Function: writeHead],
__onFinished: [Function: listener] { queue: [Array] },
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
'x-powered-by': [Array],
'strict-transport-security': [Array],
'referrer-policy': [Array]
}
},
_startAt: [ 48861, 836877392 ],
_startTime: 2021-07-01T16:44:43.740Z,
_remoteAddress: '::ffff:10.13.124.73',
context: {
http: null,
title: 'Bug Consolidator for Jira Heroku',
addonKey: 'bug-consolidator-for-jira-heroku',
clientKey: '',
token: '',
license: undefined,
localBaseUrl: 'https://bcj.herokuapp.com',
hostBaseUrl: '',
hostUrl: '',
hostStylesheetUrl: '/atlassian-connect/all.css',
hostScriptUrl: 'https://connect-cdn.atl-paas.net/all.js'
},
payload: {
hostScriptUrl: 'https://connect-cdn.atl-paas.net/all.js',
http: null,
title: 'Bug Consolidator for Jira Heroku',
addonKey: 'bug-consolidator-for-jira-heroku',
clientKey: '',
token: '',
license: undefined,
localBaseUrl: 'https://bcj.herokuapp.com',
hostBaseUrl: '',
hostUrl: '',
hostStylesheetUrl: '/atlassian-connect/all.css'
},
body: {
key: 'bug-consolidator-for-jira-heroku',
clientKey: '4c72d0bb-d200-332f-8d42-6e7b66f88ccb',
publicKey: 'MIGf... "Center part removed for privacy" ...AQAB',
sharedSecret: 'L1BD... "Center part removed for privacy" ...OLzA',
serverVersion: '100167',
pluginsVersion: '1001.0.0-SNAPSHOT',
baseUrl: 'https://hiproject.atlassian.net',
productType: 'jira',
description: 'Atlassian JIRA at https://hiproject.atlassian.net ',
eventType: 'installed'
},
_body: true,
length: undefined,
route: Route { path: '*', stack: [ [Layer] ], methods: { post: true } },
[Symbol(kCapture)]: false,
[Symbol(RequestTimeout)]: undefined
}
I could use help logging the lifecycle transaction without braking the app and trapping the error.
@RhysDiab Seeing this is your baby I´m struggling with. Do you happen to have insights into this problem of mine. All help small or big appreciated.
B.r. Halli.