filecoin-station / core

Station is a visionary network that connects your computer's idle resources to the Filecoin network and rewards you with FIL
https://filstation.app
Other
30 stars 8 forks source link

Zinnia cannot start Spark: Uncaught SyntaxError: Unexpected end of input at spark/lib/tasker.js:128:34 #581

Open sentry-io[bot] opened 2 months ago

sentry-io[bot] commented 2 months ago

Sentry Issue: STATION-CORE-C9E

ExecaError: Command failed with exit code 1: /core/modules/zinnia/zinniad spark/main.js

[2024-08-26T10:17:06Z INFO  zinniad] Starting zinniad with config CliArgs { wallet_address: "0x71Ea926BE433983D3B48E058EF17504C017587Fa", station_id: "302a300506032b65700321...
  File "/root/.cache/filecoin-station-core/sources/spark/lib/tasker.js", line 128
    export async function pickTasksFo
  File "/core/lib/zinnia.js", line 163
    await p
  File "/core/lib/zinnia.js", line 173, in catchChildProcessExit
    await Promise.race(tasks)
  File "/core/lib/zinnia.js", line 304, in run
    await Promise.all([
  File "/core/commands/station.js", line 113, in station
    await Promise.all([
...
(6 additional frame(s) were not displayed)
bajtos commented 2 months ago

Console output:

Zinnia main loop errored ExecaError: Command failed with exit code 1: /core/modules/zinnia/zinniad spark/main.js

[2024-08-26T10:17:06Z INFO  zinniad] Starting zinniad with config CliArgs { wallet_address: "0x71Ea926BE433983D3B48E058EF17504C017587Fa", station_id: "302a300506032b65700321007cef94007365d5a1afc6de686956cebdd8357448242b01e643d5baabd3ca7afd", state_root: "/root/.local/state/filecoin-station-core/modules/zinnia", cache_root: "/root/.cache/filecoin-station-core/modules/zinnia", files: ["spark/main.js"] }
[2024-08-26T10:17:06Z INFO  lassie] Starting Lassie Daemon
[2024-08-26T10:17:06Z INFO  lassie] Lassie Daemon is listening on port 45815
[2024-08-26T10:17:06Z INFO  zinniad] Starting module file:///root/.cache/filecoin-station-core/sources/spark/main.js
[2024-08-26T10:17:07Z ERROR zinniad] Uncaught SyntaxError: Unexpected end of input
        at file:///root/.cache/filecoin-station-core/sources/spark/lib/tasker.js:128:34

{"type":"activity:started","module":null}
{"type":"jobs-completed","total":11285,"modules":{"spark/main":11285}}
    at getFinalError (file:///core/node_modules/execa/lib/return/final-error.js:6:9)
    at makeError (file:///core/node_modules/execa/lib/return/result.js:108:16)
    at getAsyncResult (file:///core/node_modules/execa/lib/methods/main-async.js:174:4)
    at handlePromise (file:///core/node_modules/execa/lib/methods/main-async.js:157:17)
    at async file:///core/lib/zinnia.js:163:9
    at async catchChildProcessExit (file:///core/lib/zinnia.js:173:5)
    at async Promise.all (index 1)
    at async run (file:///core/lib/zinnia.js:304:5)
    at async Promise.all (index 0)
    at async station (file:///core/commands/station.js:113:3) {
  shortMessage: 'Command failed with exit code 1: /core/modules/zinnia/zinniad spark/main.js',
  command: '/core/modules/zinnia/zinniad spark/main.js',
  escapedCommand: '/core/modules/zinnia/zinniad spark/main.js',
  cwd: '/root/.cache/filecoin-station-core/sources',
  durationMs: 1910.665431,
  failed: true,
  timedOut: false,
  isCanceled: false,
  isGracefullyCanceled: false,
  isTerminated: false,
  isMaxBuffer: false,
  isForcefullyTerminated: false,
  exitCode: 1,
  stdout: '{"type":"activity:started","module":null}\n' +
    '{"type":"jobs-completed","total":11285,"modules":{"spark/main":11285}}',
  stderr: '[2024-08-26T10:17:06Z INFO  zinniad] Starting zinniad with config CliArgs { wallet_address: "0x71Ea926BE433983D3B48E058EF17504C017587Fa", station_id: "302a300506032b65700321007cef94007365d5a1afc6de686956cebdd8357448242b01e643d5baabd3ca7afd", state_root: "/root/.local/state/filecoin-station-core/modules/zinnia", cache_root: "/root/.cache/filecoin-station-core/modules/zinnia", files: ["spark/main.js"] }\n' +
    '[2024-08-26T10:17:06Z INFO  lassie] Starting Lassie Daemon\n' +
    '[2024-08-26T10:17:06Z INFO  lassie] Lassie Daemon is listening on port 45815\n' +
    '[2024-08-26T10:17:06Z INFO  zinniad] Starting module file:///root/.cache/filecoin-station-core/sources/spark/main.js\n' +
    '[2024-08-26T10:17:07Z ERROR zinniad] Uncaught SyntaxError: Unexpected end of input\n' +
    '        at file:///root/.cache/filecoin-station-core/sources/spark/lib/tasker.js:128:34',
  stdio: [
    undefined,
    '{"type":"activity:started","module":null}\n' +
      '{"type":"jobs-completed","total":11285,"modules":{"spark/main":11285}}',
    '[2024-08-26T10:17:06Z INFO  zinniad] Starting zinniad with config CliArgs { wallet_address: "0x71Ea926BE433983D3B48E058EF17504C017587Fa", station_id: "302a300506032b65700321007cef94007365d5a1afc6de686956cebdd8357448242b01e643d5baabd3ca7afd", state_root: "/root/.local/state/filecoin-station-core/modules/zinnia", cache_root: "/root/.cache/filecoin-station-core/modules/zinnia", files: ["spark/main.js"] }\n' +
      '[2024-08-26T10:17:06Z INFO  lassie] Starting Lassie Daemon\n' +
      '[2024-08-26T10:17:06Z INFO  lassie] Lassie Daemon is listening on port 45815\n' +
      '[2024-08-26T10:17:06Z INFO  zinniad] Starting module file:///root/.cache/filecoin-station-core/sources/spark/main.js\n' +
      '[2024-08-26T10:17:07Z ERROR zinniad] Uncaught SyntaxError: Unexpected end of input\n' +
      '        at file:///root/.cache/filecoin-station-core/sources/spark/lib/tasker.js:128:34'
  ],
  ipcOutput: [],
  pipedFrom: [],
  moduleName: 'spark',
  exitReason: 'with exit code 1'
}
bajtos commented 2 months ago

@juliangruber have you seen this error before? Is it possible that Station Core's auto-updater wrote only partial content of the file sources/spark/lib/tasker.js?

Also, IIUC, Sentry detected this error in console output. The logs also say that Reporting the problem to Sentry for inspection by the Station team. - are we reporting this issue twice? Do you know how to configure Sentry in Station Desktop to not create issues from stdout/stderr logs produced by Station Core?

juliangruber commented 2 months ago

@juliangruber have you seen this error before?

No I haven't

Is it possible that Station Core's auto-updater wrote only partial content of the file sources/spark/lib/tasker.js?

On an extraction error, Station Core will try to delete the source directory:

https://github.com/filecoin-station/core/blob/0f9198ef903173f4190392d39a7b5a6e1c4b0ec1/lib/modules.js#L222-L224

However if Station Core exits while downloading the source, yes, a partial copy will be left behind.

Also, IIUC, Sentry detected this error in console output. The logs also say that Reporting the problem to Sentry for inspection by the Station team. - are we reporting this issue twice? Do you know how to configure Sentry in Station Desktop to not create issues from stdout/stderr logs produced by Station Core?

Whether this issue has been reported once or twice isn't a high priority for me atm. Do you want to look into that?

bajtos commented 2 months ago

@juliangruber thank you for the answers. This is not urgent; I just wanted to capture the issue in a place where we are more likely to find it.