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

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

Open
sentry-io bot opened this issue Aug 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Aug 26, 2024

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)
@sentry-io sentry-io bot added the bug Something isn't working label Aug 26, 2024
@bajtos
Copy link
Member

bajtos commented Aug 26, 2024

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
Copy link
Member

bajtos commented Aug 26, 2024

@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
Copy link
Member

@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:

core/lib/modules.js

Lines 222 to 224 in 0f9198e

} catch (err) {
try {
await rm(outDir, { recursive: true })

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
Copy link
Member

bajtos commented Aug 29, 2024

@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.

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
None yet
Development

No branches or pull requests

2 participants