HiruNya / Parsons-Tool

MIT License
2 stars 1 forks source link

Execution crashing server on request #81

Closed f-fromont closed 2 years ago

f-fromont commented 2 years ago

api_1   |   for i in range(1, len(array)):
api_1   |     if array[i-1] > array[i]:
api_1   |       return i
api_1   |   return -1
api_1   | print(LinearSearch([1, 2, 3, 4, 3], 3))
api_1   |
api_1   | node:internal/process/promises:279
api_1   |             triggerUncaughtException(err, true /* fromPromise */);
api_1   |             ^
api_1   | AxiosError: connect ECONNREFUSED 127.0.0.1:4000
api_1   |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) {
api_1   |   port: 4000,
api_1   |   address: '127.0.0.1',
api_1   |   syscall: 'connect',
api_1   |   code: 'ECONNREFUSED',
api_1   |   errno: -111,
api_1   |   config: {
api_1   |     transitional: {
api_1   |       silentJSONParsing: true,
api_1   |       forcedJSONParsing: true,
api_1   |       clarifyTimeoutError: false
api_1   |     },
api_1   |     adapter: [Function: httpAdapter],
api_1   |     transformRequest: [ [Function: transformRequest] ],
api_1   |     transformResponse: [ [Function: transformResponse] ],
api_1   |     timeout: 0,
api_1   |     xsrfCookieName: 'XSRF-TOKEN',
api_1   |     xsrfHeaderName: 'X-XSRF-TOKEN',
api_1   |     maxContentLength: -1,
api_1   |     maxBodyLength: -1,
api_1   |     env: {
api_1   |       FormData: [Function: FormData] {
api_1   |         LINE_BREAK: '\r\n',
api_1   |         DEFAULT_CONTENT_TYPE: 'application/octet-stream'
api_1   |       }
api_1   |     },
api_1   |     validateStatus: [Function: validateStatus],
api_1   |     headers: {
api_1   |       Accept: 'application/json, text/plain, */*',
api_1   |       'Content-Type': 'application/json',
api_1   |       'User-Agent': 'axios/0.27.2',
api_1   |       'Content-Length': 220
api_1   |     },
api_1   |     url: 'http://localhost:4000/jobe/index.php/restapi/runs',
api_1   |     method: 'post',
api_1   |     data: '{"run_spec":{"language_id":"python3","sourcecode":"def search_out_of_order(array):\\n  for i in range(1, 
len(array)):\\n    if array[i-1] > array[i]:\\n      return i\\n  return -1\\nprint(LinearSearch([1, 2, 3, 4, 3], 3))"}}'     
api_1   |   },
api_1   |   request: <ref *2> Writable {
api_1   |     _writableState: WritableState {
api_1   |       objectMode: false,
api_1   |       highWaterMark: 16384,
api_1   |       finalCalled: false,
api_1   |       needDrain: false,
api_1   |       ending: false,
api_1   |       ended: false,
api_1   |       finished: false,
api_1   |       destroyed: false,
api_1   |       decodeStrings: true,
api_1   |       defaultEncoding: 'utf8',
api_1   |       length: 0,
api_1   |       writing: false,
api_1   |       corked: 0,
api_1   |       sync: true,
api_1   |       bufferProcessing: false,
api_1   |       onwrite: [Function: bound onwrite],
api_1   |       writecb: null,
api_1   |       writelen: 0,
api_1   |       afterWriteTickInfo: null,
api_1   |       buffered: [],
api_1   |       bufferedIndex: 0,
api_1   |       allBuffers: true,
api_1   |       allNoop: true,
api_1   |       pendingcb: 0,
api_1   |       constructed: true,
api_1   |       prefinished: false,
api_1   |       errorEmitted: false,
api_1   |       emitClose: true,
api_1   |       autoDestroy: true,
api_1   |       errored: null,
api_1   |       closed: false,
api_1   |       closeEmitted: false,
api_1   |       [Symbol(kOnFinished)]: []
api_1   |     },
api_1   |     _events: [Object: null prototype] {
api_1   |       response: [Function: handleResponse],
api_1   |       error: [Function: handleRequestError],
api_1   |       socket: [Function: handleRequestSocket]
api_1   |     },
api_1   |     _eventsCount: 3,
api_1   |     _maxListeners: undefined,
api_1   |     _options: {
api_1   |       maxRedirects: 21,
api_1   |       maxBodyLength: 10485760,
api_1   |       protocol: 'http:',
api_1   |       path: '/jobe/index.php/restapi/runs',
api_1   |       method: 'POST',
api_1   |       headers: {
api_1   |         Accept: 'application/json, text/plain, */*',
api_1   |         'Content-Type': 'application/json',
api_1   |         'User-Agent': 'axios/0.27.2',
api_1   |         'Content-Length': 220
api_1   |       },
api_1   |       agent: undefined,
api_1   |       agents: { http: undefined, https: undefined },
api_1   |       auth: undefined,
api_1   |       hostname: 'localhost',
api_1   |       port: '4000',
api_1   |       nativeProtocols: {
api_1   |         'http:': {
api_1   |           _connectionListener: [Function: connectionListener],
api_1   |           METHODS: [
api_1   |             'ACL',         'BIND',       'CHECKOUT',
api_1   |             'CONNECT',     'COPY',       'DELETE',
api_1   |             'GET',         'HEAD',       'LINK',
api_1   |             'LOCK',        'M-SEARCH',   'MERGE',
api_1   |             'MKACTIVITY',  'MKCALENDAR', 'MKCOL',
api_1   |             'MOVE',        'NOTIFY',     'OPTIONS',
api_1   |             'PATCH',       'POST',       'PROPFIND',
api_1   |             'PROPPATCH',   'PURGE',      'PUT',
api_1   |             'REBIND',      'REPORT',     'SEARCH',
api_1   |             'SOURCE',      'SUBSCRIBE',  'TRACE',
api_1   |             'UNBIND',      'UNLINK',     'UNLOCK',
api_1   |             'UNSUBSCRIBE'
api_1   |           ],
api_1   |           STATUS_CODES: {
api_1   |             '100': 'Continue',
api_1   |             '101': 'Switching Protocols',
api_1   |             '102': 'Processing',
api_1   |             '103': 'Early Hints',
api_1   |             '200': 'OK',
api_1   |             '201': 'Created',
api_1   |             '202': 'Accepted',
api_1   |             '203': 'Non-Authoritative Information',
api_1   |             '204': 'No Content',
api_1   |             '205': 'Reset Content',
api_1   |             '206': 'Partial Content',
api_1   |             '207': 'Multi-Status',
api_1   |             '208': 'Already Reported',
api_1   |             '226': 'IM Used',
api_1   |             '300': 'Multiple Choices',
api_1   |             '301': 'Moved Permanently',
api_1   |             '302': 'Found',
api_1   |             '303': 'See Other',
api_1   |             '304': 'Not Modified',
api_1   |             '305': 'Use Proxy',
api_1   |             '307': 'Temporary Redirect',
api_1   |             '308': 'Permanent Redirect',
api_1   |             '400': 'Bad Request',
api_1   |             '401': 'Unauthorized',
api_1   |             '402': 'Payment Required',
api_1   |             '403': 'Forbidden',
api_1   |             '404': 'Not Found',
api_1   |             '405': 'Method Not Allowed',
api_1   |             '406': 'Not Acceptable',
api_1   |             '407': 'Proxy Authentication Required',
api_1   |             '408': 'Request Timeout',
api_1   |             '409': 'Conflict',
api_1   |             '410': 'Gone',
api_1   |             '411': 'Length Required',
api_1   |             '412': 'Precondition Failed',
api_1   |             '413': 'Payload Too Large',
api_1   |             '414': 'URI Too Long',
api_1   |             '415': 'Unsupported Media Type',
api_1   |             '416': 'Range Not Satisfiable',
api_1   |             '417': 'Expectation Failed',
api_1   |             '418': "I'm a Teapot",
api_1   |             '421': 'Misdirected Request',
api_1   |             '422': 'Unprocessable Entity',
api_1   |             '423': 'Locked',
api_1   |             '424': 'Failed Dependency',
api_1   |             '425': 'Too Early',
api_1   |             '426': 'Upgrade Required',
api_1   |             '428': 'Precondition Required',
api_1   |             '429': 'Too Many Requests',
api_1   |             '431': 'Request Header Fields Too Large',
api_1   |             '451': 'Unavailable For Legal Reasons',
api_1   |             '500': 'Internal Server Error',
api_1   |             '501': 'Not Implemented',
api_1   |             '502': 'Bad Gateway',
api_1   |             '503': 'Service Unavailable',
api_1   |             '504': 'Gateway Timeout',
api_1   |             '505': 'HTTP Version Not Supported',
api_1   |             '506': 'Variant Also Negotiates',
api_1   |             '507': 'Insufficient Storage',
api_1   |             '508': 'Loop Detected',
api_1   |             '509': 'Bandwidth Limit Exceeded',
api_1   |             '510': 'Not Extended',
api_1   |             '511': 'Network Authentication Required'
api_1   |           },
api_1   |           Agent: [Function: Agent] { defaultMaxSockets: Infinity },
api_1   |           ClientRequest: [Function: ClientRequest],
api_1   |           IncomingMessage: [Function: IncomingMessage],
api_1   |           OutgoingMessage: [Function: OutgoingMessage],
api_1   |           Server: [Function: Server],
api_1   |           ServerResponse: [Function: ServerResponse],
api_1   |           createServer: [Function: createServer],
api_1   |           validateHeaderName: [Function: __node_internal_],
api_1   |           validateHeaderValue: [Function: __node_internal_],
api_1   |           get: [Function: get],
api_1   |           request: [Function: request],
api_1   |           maxHeaderSize: [Getter],
api_1   |           globalAgent: [Getter/Setter]
api_1   |         },
api_1   |         'https:': {
api_1   |           Agent: [Function: Agent],
api_1   |           globalAgent: Agent {
api_1   |             _events: [Object: null prototype],
api_1   |             _eventsCount: 2,
api_1   |             _maxListeners: undefined,
api_1   |             defaultPort: 443,
api_1   |             protocol: 'https:',
api_1   |             options: [Object: null prototype],
api_1   |             requests: [Object: null prototype] {},
api_1   |             sockets: [Object: null prototype] {},
api_1   |             freeSockets: [Object: null prototype] {},
api_1   |             keepAliveMsecs: 1000,
api_1   |             keepAlive: false,
api_1   |             maxSockets: Infinity,
api_1   |             maxFreeSockets: 256,
api_1   |             scheduling: 'lifo',
api_1   |             maxTotalSockets: Infinity,
api_1   |             totalSocketCount: 0,
api_1   |             maxCachedSessions: 100,
api_1   |             _sessionCache: [Object],
api_1   |             [Symbol(kCapture)]: false
api_1   |           },
api_1   |           Server: [Function: Server],
api_1   |           createServer: [Function: createServer],
api_1   |           get: [Function: get],
api_1   |           request: [Function: request]
api_1   |         }
api_1   |       },
api_1   |       pathname: '/jobe/index.php/restapi/runs'
api_1   |     },
api_1   |     _ended: false,
api_1   |     _ending: true,
api_1   |     _redirectCount: 0,
api_1   |     _redirects: [],
api_1   |     _requestBodyLength: 220,
api_1   |     _requestBodyBuffers: [
api_1   |       {
api_1   |         data: Buffer(220) [Uint8Array] [
api_1   |           123,  34, 114, 117, 110,  95, 115, 112, 101,  99,  34,  58,
api_1   |           123,  34, 108,  97, 110, 103, 117,  97, 103, 101,  95, 105,
api_1   |           100,  34,  58,  34, 112, 121, 116, 104, 111, 110,  51,  34,
api_1   |            44,  34, 115, 111, 117, 114,  99, 101,  99, 111, 100, 101,
api_1   |            34,  58,  34, 100, 101, 102,  32, 115, 101,  97, 114,  99,
api_1   |           104,  95, 111, 117, 116,  95, 111, 102,  95, 111, 114, 100,
api_1   |           101, 114,  40,  97, 114, 114,  97, 121,  41,  58,  92, 110,
api_1   |            32,  32, 102, 111, 114,  32, 105,  32, 105, 110,  32, 114,
api_1   |            97, 110, 103, 101,
api_1   |           ... 120 more items
api_1   |         ],
api_1   |         encoding: undefined
api_1   |       }
api_1   |     ],
api_1   |     _onNativeResponse: [Function (anonymous)],
api_1   |     _currentRequest: <ref *1> ClientRequest {
api_1   |       _events: [Object: null prototype] {
api_1   |         response: [Function: bound onceWrapper] {
api_1   |           listener: [Function (anonymous)]
api_1   |         },
api_1   |         abort: [Function (anonymous)],
api_1   |         aborted: [Function (anonymous)],
api_1   |         connect: [Function (anonymous)],
api_1   |         error: [Function (anonymous)],
api_1   |         socket: [Function (anonymous)],
api_1   |         timeout: [Function (anonymous)]
api_1   |       },
api_1   |       _eventsCount: 7,
api_1   |       _maxListeners: undefined,
api_1   |       outputData: [],
api_1   |       outputSize: 0,
api_1   |       writable: true,
api_1   |       destroyed: false,
api_1   |       _last: true,
api_1   |       chunkedEncoding: false,
api_1   |       shouldKeepAlive: false,
api_1   |       maxRequestsOnConnectionReached: false,
api_1   |       _defaultKeepAlive: true,
api_1   |       useChunkedEncodingByDefault: true,
api_1   |       sendDate: false,
api_1   |       _removedConnection: false,
api_1   |       _removedContLen: false,
api_1   |       _removedTE: false,
api_1   |       _contentLength: null,
api_1   |       _hasBody: true,
api_1   |       _trailer: '',
api_1   |       finished: false,
api_1   |       _headerSent: true,
api_1   |       _closed: false,
api_1   |       socket: Socket {
api_1   |         connecting: false,
api_1   |         _hadError: true,
api_1   |         _parent: null,
api_1   |         _host: 'localhost',
api_1   |         _readableState: ReadableState {
api_1   |           objectMode: false,
api_1   |           highWaterMark: 16384,
api_1   |           buffer: BufferList { head: null, tail: null, length: 0 },
api_1   |           length: 0,
api_1   |           pipes: [],
api_1   |           flowing: true,
api_1   |           ended: false,
api_1   |           endEmitted: false,
api_1   |           reading: true,
api_1   |           constructed: true,
api_1   |           sync: false,
api_1   |           needReadable: true,
api_1   |           emittedReadable: false,
api_1   |           readableListening: false,
api_1   |           resumeScheduled: false,
api_1   |           errorEmitted: true,
api_1   |           emitClose: false,
api_1   |           autoDestroy: true,
api_1   |           destroyed: true,
api_1   |           errored: Error: connect ECONNREFUSED 127.0.0.1:4000
api_1   |               at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) {
api_1   |             errno: -111,
api_1   |             code: 'ECONNREFUSED',
api_1   |             syscall: 'connect',
api_1   |             address: '127.0.0.1',
api_1   |             port: 4000
api_1   |           },
api_1   |           closed: true,
api_1   |           closeEmitted: true,
api_1   |           defaultEncoding: 'utf8',
api_1   |           awaitDrainWriters: null,
api_1   |           multiAwaitDrain: false,
api_1   |           readingMore: false,
api_1   |           dataEmitted: false,
api_1   |           decoder: null,
api_1   |           encoding: null,
api_1   |           [Symbol(kPaused)]: false
api_1   |         },
api_1   |         _events: [Object: null prototype] {
api_1   |           end: [Function: onReadableStreamEnd],
api_1   |           connect: [ [Function], [Function], [Function] ],
api_1   |           free: [Function: onFree],
api_1   |           close: [ [Function: onClose], [Function: socketCloseListener] ],
api_1   |           timeout: [Function: onTimeout],
api_1   |           agentRemove: [Function: onRemove],
api_1   |           error: [Function: socketErrorListener],
api_1   |           drain: [Function: ondrain]
api_1   |         },
api_1   |         _eventsCount: 8,
api_1   |         _maxListeners: undefined,
api_1   |         _writableState: WritableState {
api_1   |           objectMode: false,
api_1   |           highWaterMark: 16384,
api_1   |           finalCalled: false,
api_1   |           needDrain: false,
api_1   |           ending: false,
api_1   |           ended: false,
api_1   |           finished: false,
api_1   |           destroyed: true,
api_1   |           decodeStrings: false,
api_1   |           defaultEncoding: 'utf8',
api_1   |           length: 429,
api_1   |           writing: true,
api_1   |           corked: 0,
api_1   |           sync: false,
api_1   |           bufferProcessing: false,
api_1   |           onwrite: [Function: bound onwrite],
api_1   |           writecb: [Function (anonymous)],
api_1   |           writelen: 429,
api_1   |           afterWriteTickInfo: null,
api_1   |           buffered: [],
api_1   |           bufferedIndex: 0,
api_1   |           allBuffers: true,
api_1   |           allNoop: true,
api_1   |           pendingcb: 1,
api_1   |           constructed: true,
api_1   |           prefinished: false,
api_1   |           errorEmitted: true,
api_1   |           emitClose: false,
api_1   |           autoDestroy: true,
api_1   |           errored: Error: connect ECONNREFUSED 127.0.0.1:4000
api_1   |               at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) {
api_1   |             errno: -111,
api_1   |             code: 'ECONNREFUSED',
api_1   |             syscall: 'connect',
api_1   |             address: '127.0.0.1',
api_1   |             port: 4000
api_1   |           },
api_1   |           closed: true,
api_1   |           closeEmitted: true,
api_1   |           [Symbol(kOnFinished)]: []
api_1   |         },
api_1   |         allowHalfOpen: false,
api_1   |         _sockname: null,
api_1   |         _pendingData: [
api_1   |           {
api_1   |             chunk: 'POST /jobe/index.php/restapi/runs HTTP/1.1\r\n' +
api_1   |               'Accept: application/json, text/plain, */*\r\n' +
api_1   |               'Content-Type: application/json\r\n' +
api_1   |               'User-Agent: axios/0.27.2\r\n' +
api_1   |               'Content-Length: 220\r\n' +
api_1   |               'Host: localhost:4000\r\n' +
api_1   |               'Connection: close\r\n' +
api_1   |               '\r\n',
api_1   |             encoding: 'latin1',
api_1   |             callback: [Function: nop]
api_1   |           },
api_1   |           {
api_1   |             chunk: [Buffer [Uint8Array]],
api_1   |             encoding: 'buffer',
api_1   |             callback: [Function (anonymous)]
api_1   |           },
api_1   |           allBuffers: false
api_1   |         ],
api_1   |         _pendingEncoding: '',
api_1   |         server: null,
api_1   |         _server: null,
api_1   |         parser: null,
api_1   |         _httpMessage: [Circular *1],
api_1   |         [Symbol(async_id_symbol)]: 204,
api_1   |         [Symbol(kHandle)]: null,
api_1   |         [Symbol(lastWriteQueueSize)]: 0,
api_1   |         [Symbol(timeout)]: null,
api_1   |         [Symbol(kBuffer)]: null,
api_1   |         [Symbol(kBufferCb)]: null,
api_1   |         [Symbol(kBufferGen)]: null,
api_1   |         [Symbol(kCapture)]: false,
api_1   |         [Symbol(kSetNoDelay)]: false,
api_1   |         [Symbol(kSetKeepAlive)]: true,
api_1   |         [Symbol(kSetKeepAliveInitialDelay)]: 60,
api_1   |         [Symbol(kBytesRead)]: 0,
api_1   |         [Symbol(kBytesWritten)]: 0
api_1   |       },
api_1   |       _header: 'POST /jobe/index.php/restapi/runs HTTP/1.1\r\n' +
api_1   |         'Accept: application/json, text/plain, */*\r\n' +
api_1   |         'Content-Type: application/json\r\n' +
api_1   |         'User-Agent: axios/0.27.2\r\n' +
api_1   |         'Content-Length: 220\r\n' +
api_1   |         'Host: localhost:4000\r\n' +
api_1   |         'Connection: close\r\n' +
api_1   |         '\r\n',
api_1   |       _keepAliveTimeout: 0,
api_1   |       _onPendingData: [Function: nop],
api_1   |       agent: Agent {
api_1   |         _events: [Object: null prototype] {
api_1   |           free: [Function (anonymous)],
api_1   |           newListener: [Function: maybeEnableKeylog]
api_1   |         },
api_1   |         _eventsCount: 2,
api_1   |         _maxListeners: undefined,
api_1   |         defaultPort: 80,
api_1   |         protocol: 'http:',
api_1   |         options: [Object: null prototype] { path: null },
api_1   |         requests: [Object: null prototype] {},
api_1   |         sockets: [Object: null prototype] { 'localhost:4000:': [ [Socket] ] },
api_1   |         freeSockets: [Object: null prototype] {},
api_1   |         keepAliveMsecs: 1000,
api_1   |         keepAlive: false,
api_1   |         maxSockets: Infinity,
api_1   |         maxFreeSockets: 256,
api_1   |         scheduling: 'lifo',
api_1   |         maxTotalSockets: Infinity,
api_1   |         totalSocketCount: 1,
api_1   |         [Symbol(kCapture)]: false
api_1   |       },
api_1   |       socketPath: undefined,
api_1   |       method: 'POST',
api_1   |       maxHeaderSize: undefined,
api_1   |       insecureHTTPParser: undefined,
api_1   |       path: '/jobe/index.php/restapi/runs',
api_1   |       _ended: false,
api_1   |       res: null,
api_1   |       aborted: false,
api_1   |       timeoutCb: null,
api_1   |       upgradeOrConnect: false,
api_1   |       parser: null,
api_1   |       maxHeadersCount: null,
api_1   |       reusedSocket: false,
api_1   |       host: 'localhost',
api_1   |       protocol: 'http:',
api_1   |       _redirectable: [Circular *2],
api_1   |       [Symbol(kCapture)]: false,
api_1   |       [Symbol(kNeedDrain)]: false,
api_1   |       [Symbol(corked)]: 0,
api_1   |       [Symbol(kOutHeaders)]: [Object: null prototype] {
api_1   |         accept: [ 'Accept', 'application/json, text/plain, */*' ],
api_1   |         'content-type': [ 'Content-Type', 'application/json' ],
api_1   |         'user-agent': [ 'User-Agent', 'axios/0.27.2' ],
api_1   |         'content-length': [ 'Content-Length', 220 ],
api_1   |         host: [ 'Host', 'localhost:4000' ]
api_1   |       }
api_1   |     },
api_1   |     _currentUrl: 'http://localhost:4000/jobe/index.php/restapi/runs',
api_1   |     [Symbol(kCapture)]: false
api_1   |   }
api_1   | }
api_1   | error Command failed with exit code 1.
api_1   | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
parsons-tool-backend_api_1 exited with code 1```
f-fromont commented 2 years ago

On localhost using docker container, could be to do with no test cases for a problem, however the crashing of the server part is not ideal

HiruNya commented 2 years ago

From our discussion online, it seems to have been a problem due to the docker image being stale on localhost. This is fixed now but @f-fromont feel free to re-open if needed.