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

500 error when layout editor attempts to save changes #1473

Closed
Paul-Reed opened this issue Nov 15, 2024 · 8 comments · Fixed by #1488
Closed

500 error when layout editor attempts to save changes #1473

Paul-Reed opened this issue Nov 15, 2024 · 8 comments · Fixed by #1488
Assignees
Labels
bug Something isn't working

Comments

@Paul-Reed
Copy link
Contributor

Paul-Reed commented Nov 15, 2024

Current Behavior

Open Layout Editor, make changes to layout and attempt to save results in a error 500, and changes not saved.

dash

and developer console...

error

Expected Behavior

Open Layout Editor, make changes to layout and select save. The changes should then be saved.

Steps To Reproduce

As above

Environment

  • Dashboard version: 1.19.1
  • Node-RED version: 4.0.5
  • Node.js version: 20.16
  • npm version: 10.8.1
  • Platform/OS: Oracle remote cloud server / Canonical-Ubuntu-22.04-aarch64-2023.02.15-0
  • Browser: Chrome Version 130.0.6723.119

Have you provided an initial effort estimate for this issue?

I am not a FlowFuse team member

@Paul-Reed Paul-Reed added bug Something isn't working needs-triage Needs looking at to decide what to do labels Nov 15, 2024
@joepavitt
Copy link
Collaborator

Do you have anything different about your NR setup we should be aware of?

@Paul-Reed
Copy link
Contributor Author

It's pretty much a standard install, and regularly updated, both only using the RP script.
I can't think of anything 'different' from 'out of the box' other than settings.js is owned by root & https is enabled.
The dashboard has been used since the very early days of DB2, no errors in logs & no other problems that I'm aware of.
The layout used in that example is 'fixed'.

@Paul-Reed
Copy link
Contributor Author

Paul-Reed commented Nov 16, 2024

In the node-red-log, this is what I get when I try and save the changes;

NOTE - Ports & URL's redacted

url http://0.0.0.0:redacted/flows
{
  groups: [
    {
      id: '25f065c072b233c0',
      name: 'gauges',
      page: 'd6557c66b0d2c002',
      width: 10,
      height: '6',
      order: 1,
      showTitle: false,
      className: '',
      visible: 'true',
      disabled: 'false',
      groupType: 'default',
      _users: [Array]
    },
    {
      id: '4c637ca6c57dac54',
      name: 'Misc',
      page: 'd6557c66b0d2c002',
      width: '14',
      height: '5',
      order: 2,
      showTitle: false,
      className: '',
      visible: true,
      disabled: 'false',
      _users: [Array],
      groupType: 'default'
    }
  ]
} 7q5s5f2ylyw ae3d4aeb3f977a90
AxiosError: socket hang up
    at AxiosError.from (/home/ubuntu/.node-red/node_modules/axios/dist/node/axios.cjs:876:14)
    at RedirectableRequest.handleRequestError (/home/ubuntu/.node-red/node_modules/axios/dist/node/axios.cjs:3156:25)
    at RedirectableRequest.emit (node:events:519:28)
    at eventHandlers.<computed> (/home/ubuntu/.node-red/node_modules/follow-redirects/index.js:49:24)
    at ClientRequest.emit (node:events:519:28)
    at Socket.socketOnEnd (node:_http_client:524:9)
    at Socket.emit (node:events:531:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
    at Axios.request (/home/ubuntu/.node-red/node_modules/axios/dist/node/axios.cjs:4287:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ECONNRESET',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [ 'xhr', 'http', 'fetch' ],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function], Blob: [class Blob] },
    validateStatus: [Function: validateStatus],
    headers: Object [AxiosHeaders] {
      Accept: 'application/json',
      'Content-Type': undefined,
      'Node-RED-API-Version': 'v2',
      cookie: 'cf_clearance=xxx-1731751524-1.2.1.1-xxx.xxx.xxx.xxx.xxx.tAi.xxx.xxx.xxx.xxx',
      authorization: 'Bearer xxx/xxx+xxx+xxx/w/xxx=',
      referer: 'https://redacted/dashboard/energy?edit-key=xxx',
      'User-Agent': 'axios/1.7.7',
      'Accept-Encoding': 'gzip, compress, deflate, br'
    },
    method: 'get',
    url: 'http://0.0.0.0:redacted/flows',
    data: undefined
  },
  request: <ref *1> Writable {
    _events: {
      close: undefined,
      error: [Function: handleRequestError],
      prefinish: undefined,
      finish: undefined,
      drain: undefined,
      response: [Function: handleResponse],
      socket: [Function: handleRequestSocket]
    },
    _writableState: WritableState {
      highWaterMark: 16384,
      length: 0,
      corked: 0,
      onwrite: [Function: bound onwrite],
      writelen: 0,
      bufferedIndex: 0,
      pendingcb: 0,
      [Symbol(kState)]: 17580812,
      [Symbol(kBufferedValue)]: null
    },
    _maxListeners: undefined,
    _options: {
      maxRedirects: 21,
      maxBodyLength: Infinity,
      protocol: 'http:',
      path: '/flows',
      method: 'GET',
      headers: [Object: null prototype],
      agents: [Object],
      auth: undefined,
      family: undefined,
      beforeRedirect: [Function: dispatchBeforeRedirect],
      beforeRedirects: [Object],
      hostname: '0.0.0.0',
      port: 'redacted',
      agent: undefined,
      nativeProtocols: [Object],
      pathname: '/flows'
    },
    _ended: true,
    _ending: true,
    _redirectCount: 0,
    _redirects: [],
    _requestBodyLength: 0,
    _requestBodyBuffers: [],
    _eventsCount: 3,
    _onNativeResponse: [Function (anonymous)],
    _currentRequest: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: true,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [Socket],
      _header: 'GET /flows HTTP/1.1\r\n' +
        'Accept: application/json\r\n' +
        'Node-RED-API-Version: v2\r\n' +
        'cookie: cf_clearance=xxx-xxx-1.2.1.1-xxx.xxx.xxx.xxx.xxxx.tAi.xxx.xxx.xxx.xxx\r\n' +
        'authorization: Bearer xxx/xxx+xxx+xxx/w/xxx=\r\n' +
        'referer: https://redacted/dashboard/energy?edit-key=7q5s5f2ylyw\r\n' +
        'User-Agent: axios/1.7.7\r\n' +
        'Accept-Encoding: gzip, compress, deflate, br\r\n' +
        'Host: 0.0.0.0:redacted\r\n' +
        'Connection: keep-alive\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      joinDuplicateHeaders: undefined,
      path: '/flows',
      _ended: false,
      res: null,
      aborted: false,
      timeoutCb: [Function: emitRequestTimeout],
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: '0.0.0.0',
      protocol: 'http:',
      _redirectable: [Circular *1],
      [Symbol(shapeMode)]: false,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(errored)]: null,
      [Symbol(kHighWaterMark)]: 16384,
      [Symbol(kRejectNonStandardBodyWrites)]: false,
      [Symbol(kUniqueHeaders)]: null
    },
    _currentUrl: 'http://0.0.0.0:redacted/flows',
    [Symbol(shapeMode)]: true,
    [Symbol(kCapture)]: false
  },
  cause: Error: socket hang up
      at Socket.socketOnEnd (node:_http_client:524:23)
      at Socket.emit (node:events:531:35)
      at endReadableNT (node:internal/streams/readable:1696:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    code: 'ECONNRESET'
  }
}

@joepavitt joepavitt moved this from Backlog to In Progress in Dashboard Backlog Nov 18, 2024
@joepavitt joepavitt removed the needs-triage Needs looking at to decide what to do label Nov 18, 2024
@Steve-Mcl
Copy link
Contributor

Hi Paul.

i see from your screenshot the URL was xxxxxxxx.co.uk do you have local access to try this via IP address?

Platform/OS: Ubuntu 24.04 Cloud

Where is this running? locally? on a cloud platform?

Do you have any other devices you can test this on?

@Paul-Reed
Copy link
Contributor Author

do you have local access to try this via IP address?

No, not without a number of changes (ssh enforced - cloudflare)

Where is this running? locally? on a cloud platform?

It's a Oracle remote cloud server

Do you have any other devices you can test this on?

I also have a 2nd Oracle cloud server which I've just tried, and get the exact same result.
I've just updated both, to be the same versions, and also updated/dist upgrade both operating systems.

both servers
Dashboard version: 1.19.1
Node-RED version: 4.0.5
OS Canonical-Ubuntu-22.04-aarch64-2023.02.15-0
Node.js version: v20.18
npm version: 10.8.2

2nd server

Steve-Mcl added a commit that referenced this issue Nov 19, 2024
@Steve-Mcl Steve-Mcl linked a pull request Nov 19, 2024 that will close this issue
10 tasks
@Steve-Mcl Steve-Mcl linked a pull request Nov 20, 2024 that will close this issue
10 tasks
@bartbutenaers
Copy link
Contributor

@Paul-Reed ,
I see that @Steve-Mcl has merged some pull requests related to this issue.
Does this mean your problem is now solved, or am I mistaken?
Thanks!

@Paul-Reed
Copy link
Contributor Author

I haven't closed it because Steve has linked this to close via #1488
But yes, can be closed, issue fixed.

@Steve-Mcl
Copy link
Contributor

It should have auto closed when merged to main.

Closing now.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Dashboard Backlog Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
4 participants