Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Roadblock crashes when saving #25

Open
ruphy opened this issue Mar 7, 2019 · 8 comments
Open

Roadblock crashes when saving #25

ruphy opened this issue Mar 7, 2019 · 8 comments

Comments

@ruphy
Copy link

ruphy commented Mar 7, 2019

Expected Behavior

Success!

Actual Behavior

Console log:

ℹ️ Running 2 post-processing tasks
💾 Exporting statistics as json to /data
ℹ️ Roadblock processing complete
(node:4025) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: Callback must be a funcn
at maybeCallback (fs.js:129:9)
at Object.writeFile (fs.js:1156:14)
at saveToFile (/usr/local/lib/node_modules/@zalando/roadblock/export/client.js:11:6)
at ExportClient.export (/usr/local/lib/node_modules/@zalando/roadblock/export/client.js:39:5)
(node:4025) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either)
(node:4025) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, p.

Steps to Reproduce the Problem

  1. Run roadblock
  2. Wait for it to finish downloading
  3. 💥

Specifications

  • Version: latest on npm
  • Platform: Mac OS X
$ npm --version
6.4.1
@perploug
Copy link
Contributor

perploug commented Mar 7, 2019

Hey @ruphy - could you share the roadblock.json config (without tokens etc) So I can see what it attempts to run

@perploug
Copy link
Contributor

perploug commented Mar 7, 2019

Seems like this might be due to a missing github token in the configuration, or that the token does not have the right access, ensure it has acccess to the orgs you want to query and that it has permission to access repo, repo:status, public_repo, read:org, read:user, read:discussion

@ruphy
Copy link
Author

ruphy commented Mar 11, 2019

Hi,
I double-checked the permissions and confirm they are correct: read:discussion, read:org, read:user, repo
Here's the file:

{
    "github": {
        "token": "***"
    },
    "tasks": [
        "pre/*",
        "org/*",
        "repo/releases",
        "post/*"
    ],
    "orgs": [
        "italia"
    ]
}

@perploug
Copy link
Contributor

Will see if I can recreate - could you as a quick test, try to create a folder called "export" inside the folder where you have the roadblock.json file - might be a case of a missing folder causing the export to fail.

@ruphy
Copy link
Author

ruphy commented Mar 12, 2019

I created a directory, no meaningful change.
However, I see this line:

  💾   Exporting statistics as json to /data

is it simply possible that /data is simply not writable by the roadblock user?

@ruphy
Copy link
Author

ruphy commented Mar 12, 2019

Two more pieces of debug information:

  • I tried to chown /data to the current user (it was an old MongoDB installation), no change in behiavor
  • I do find a roadblock.sqlite in the current directory which seems to contain most of the downloaded data

@perploug
Copy link
Contributor

Updated master and npm with improved token validation and error feedback during data collection - should give you better hints at what is wrong - if everything runs smoothly the end result will be a sqlite file with all the data which you can then query

@ruphy
Copy link
Author

ruphy commented Mar 13, 2019

I updated roadblock to latest npm version (1.1.0): I confirm I find a roadblock.sqlite file at the end of the run which contains most (all?) of the data but there's still the same error before exiting:

 ℹ️   Roadblock processing complete
(node:32294) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:129:9)
    at Object.writeFile (fs.js:1156:14)
    at saveToFile (/usr/local/lib/node_modules/@zalando/roadblock/export/client.js:11:6)
    at ExportClient.export (/usr/local/lib/node_modules/@zalando/roadblock/export/client.js:39:5)
(node:32294) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:32294) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

...at this point I am wondering if it's only a false flag?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants