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

Last build seems to habe broken gitlab support #41

Closed
abyss1 opened this issue Mar 17, 2017 · 11 comments
Closed

Last build seems to habe broken gitlab support #41

abyss1 opened this issue Mar 17, 2017 · 11 comments
Labels

Comments

@abyss1
Copy link

abyss1 commented Mar 17, 2017

So I noticed yesterday I had an issue updating my builds after restarting my container.

After some back and forth I found this :

1:45:52 PM | GitLab | url: http://gitlab
1:45:52 PM | GitLab | slugs: [ '*/*' ]
1:45:52 PM | GitLab | intervals: { disabled: 3600000, empty: 60000, default: 60000 }
1:45:52 PM | GitLab | debug: true
node-build-monitor is listening on port 3000
1:45:52 PM | GitLab | Fetching new projects...
1:45:52 PM | GitLab | Fetching http://gitlab/api/v3/projects?page=1&per_page=100
crypto.js:74
  this._handle.update(data, encoding);
               ^

TypeError: Data must be a string or a buffer
    at Hash.update (crypto.js:74:16)
    at generateAndApplyETags (/build-mon/app/monitor.js:14:18)
    at /build-mon/app/monitor.js:168:13
    at /build-mon/node_modules/async/lib/async.js:52:16
    at done (/build-mon/node_modules/async/lib/async.js:246:17)
    at /build-mon/node_modules/async/lib/async.js:44:16
    at /build-mon/app/monitor.js:162:17
    at /build-mon/app/services/GitLab.js:456:21
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
error: Forever detected script exited with code: 1

I havent updated or changed anythign onthe gitlab side I only restarted the container. I did also try to rebuild the container locally but same result.

@marcells
Copy link
Owner

Which version did you use before your update? Maybe you can take a look at the commits of the gitlab.js file, to see what has changed.

@abyss1
Copy link
Author

abyss1 commented Mar 17, 2017

no sure to be fair. I pulled it about a little over a week ago.

Version I was running was from 7th of march or before. I actually suspect that the container update with the newer software versions was is more the issue then you code to be fair. Unless they have a hand in hand change.

@marcells
Copy link
Owner

Hm, the dependencies update might have to do something with your problem. But I looks more like that your gitlab server is returning some unexpected data. Not sure.

Do you think you can take a look on this issue and make a pull request with the fix? It's hard for me to reproduce.

@abyss1
Copy link
Author

abyss1 commented Mar 17, 2017

I can sure. I can see about giving you access to the gitlab api output aswell.

Hmmm ok so , I reverted all the changes I could see on github and rebuild the container. At this point it dawned on me that I was using containers and not a straight compiled version. So I looked and the node container also got an update. And the error at hand is actually something that comes along with the node base image I believe.

SO I will also have a look using different container images as a base for testing :)

@marcells
Copy link
Owner

Thanks for taking a look at it.

I'll check how to tag each container with a version, when something changed. So, in future everyone can go back easily, if there are any issues.

@marcells
Copy link
Owner

@abyss1 Is your issue fixed with pr #42?

@marcells marcells added the bug label Mar 21, 2017
@abyss1
Copy link
Author

abyss1 commented Mar 23, 2017

Jup works now, seems like the issue was related to the new base image in the end, but up and running again.

@abyss1 abyss1 closed this as completed Mar 23, 2017
@marcells
Copy link
Owner

In future you can revert easily to the old version, cause the docker images are now versioned.
See: #40 (comment)

@johannesvaltonen
Copy link

Hi. I am receiving exactly the same exception, the difference being that there was 1 build found. This is my first time trying out this build monitor with our GitLab instance.

Here's the censored output:

09:16:09 | GitLab | url: https://our-gitlab
09:16:09 | GitLab | slugs: [ 'our-group/our-project' ]
09:16:09 | GitLab | intervals: { disabled: 3600000, empty: 60000, default: 60000 }
09:16:09 | GitLab | debug: true
09:16:09 | Check for builds...
node-build-monitor 0.9.16 is listening on port 3000
09:16:09 | GitLab | Fetching new projects...
09:16:09 | GitLab | Fetching https://our-gitlab/api/v3/projects?page=1&per_page=100
09:16:09 | 1 builds found....
crypto.js:76
  this._handle.update(data, encoding);
               ^

TypeError: Data must be a string or a buffer
    at Hash.update (crypto.js:76:16)
    at generateAndApplyETags (C:\Code\GitHub\node-build-monitor\app\monitor.js:14:18)
    at C:\Code\GitHub\node-build-monitor\app\monitor.js:168:13
    at C:\Code\GitHub\node-build-monitor\node_modules\async\dist\async.js:359:16
    at iteratorCallback (C:\Code\GitHub\node-build-monitor\node_modules\async\dist\async.js:935:13)
    at C:\Code\GitHub\node-build-monitor\node_modules\async\dist\async.js:843:16
    at C:\Code\GitHub\node-build-monitor\app\monitor.js:162:17
    at C:\Code\GitHub\node-build-monitor\app\services\GitLab.js:425:21
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Any advice on how to start debugging this?

@marcells
Copy link
Owner

Hm, try to make a console.log(build) in Line 11 of app/monitor.js. Looks like there is a strange result returned from the GitLab service.

If build is null or something like this then you have to take a deeper look at the app/services/GitLab.js file and check why it returns wrong "builds".

@johannesvaltonen
Copy link

Yes, build is null there. I fiddled with the configuration, and actually noticed that this error occurs only when I have set latestBuildOnly to true. With false everything works fine.

I tried to debug a little further. In GitLab.js I never got a response from requestAllPages. The callback from the request never got invoked. I don't know how to continue from there... Any ideas?

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

No branches or pull requests

3 participants