Unable to commit Node-RED project into GitLab

886 views
Skip to first unread message

Shashank

unread,
Feb 1, 2018, 7:18:14 AM2/1/18
to Node-RED
I have upgraded my Node-RED version to 0.18 and as per the documentation I have enabled project and created a new sample flow with in the project. I have configured gitLab repository in  Project Settings ->Git remotes. The repository is public and accessed over http. 

When I am trying to commit my project, it is not getting committed into my gitLab account.  I have followed the steps mentioned as per official documentation. I am getting the following message with verified on remote branch.




When I tried to pull the code I see the following issue in the logs


TypeError: Cannot read property 'fetch' of undefined

    at Project.pull (/usr/lib/node_modules/node-red/red/runtime/storage/localfilesystem/projects/Project.js:525:127)

    at Object.pull (/usr/lib/node_modules/node-red/red/runtime/storage/localfilesystem/projects/index.js:235:26)

    at /usr/lib/node_modules/node-red/red/api/editor/projects/index.js:354:38

    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)

    at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13)

    at /usr/lib/node_modules/node-red/red/api/auth/index.js:63:13

    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)

    at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13)

    at Route.dispatch (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:112:3)

    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)


How to resolve this issue and commit the project into gitLab?

Thx

Nick O'Leary

unread,
Feb 1, 2018, 7:29:35 AM2/1/18
to Node-RED Mailing List
What happens if you tick the 'set as upstream branch' option then click the pull button?

I'm intrigued to know how you already have your repo both so far ahead and behind the remote.... you may find in that state you'll need to resort to the git command line to get things synced back together.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/8cc1e6d4-6bb0-4ce0-99fe-4de6c19c1f7f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Shashank

unread,
Feb 1, 2018, 7:33:05 AM2/1/18
to Node-RED
It throws the following error

TypeError: Cannot read property 'undefined' of undefined
    at /usr/lib/node_modules/node-red/red/runtime/storage/localfilesystem/projects/Project.js:521:93
    at tryCatchReject (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:845:30)
    at runContinuation1 (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:804:4)
    at Fulfilled.when (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:592:4)
    at Pending.run (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:483:13)
    at Scheduler._drain (/usr/lib/node_modules/node-red/node_modules/when/lib/Scheduler.js:62:19)
    at Scheduler.drain (/usr/lib/node_modules/node-red/node_modules/when/lib/Scheduler.js:27:9)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Also, I am encountering another issue i.e., At times I am unable to see the remote branches even after defining it.

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Shashank

unread,
Feb 1, 2018, 8:51:51 AM2/1/18
to Node-RED
I have created a new repository and I am unable to push the code. I am getting the following message 

Your local branch is not currently tracking a remote branch.

Kindly suggest if the project should already exists in the repo

Nick O'Leary

unread,
Feb 1, 2018, 9:18:24 AM2/1/18
to node...@googlegroups.com

Please remember this is a brand new feature releases as a preview in the 0.18 release.

You may well be hitting an unexpected edge case.

I'm currently away from my computer so can't help right now.

It would help if you detailed the exact steps you took to hit this error.

Nick


Shashank

unread,
Feb 1, 2018, 9:33:16 AM2/1/18
to Node-RED
Below are the steps I followed for the setup

Step 1: I have created a project and a sample flow with in the project.

Step 2: I have created a  new project in Git Lab

Step 3: I have added the GitLab project's repository URL (over http) in Node-RED (Info->Project->Settings->Git Remotes

Step 4: Committed the local changes but at unable to commit to gitlab repository(Remote Branching)

Thx

Nick O'Leary

unread,
Feb 1, 2018, 11:28:03 AM2/1/18
to Node-RED Mailing List
Hi,

in your screen shot earlier, you had 36 commits available to pull down and 16 commits available to push.

So when you say:

>  Step 4: Committed the local changes but at unable to commit to gitlab repository(Remote Branching)

What *exactly* are you trying to do? In that state the UI will only let you Pull down first. So... are you clicking Pull?

Nick



To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Nick O'Leary

unread,
Feb 1, 2018, 12:10:38 PM2/1/18
to Node-RED Mailing List
Hi,

I have found and fixed an issue if, having added your first remote, you have to Pull rather than Push as your first action.

Will be in 0.18.1

Nick

Shashank

unread,
Feb 1, 2018, 1:14:07 PM2/1/18
to Node-RED
Hi Nick,

When does 0.18.1 will get released?

How do I commit to gitLab? Do I need to first create and commit the project to gitLab from the command line and then pull it from repo via NodeRed and make changes to the flow and then push it?

Thx

Nick O'Leary

unread,
Feb 1, 2018, 1:26:06 PM2/1/18
to node...@googlegroups.com

> When does 0.18.1 will get released?

Maybe tonight. Maybe tomorrow.

> How do I commit to gitLab?

You _should_ be able to do it all from within the NR editor.

1. Create project, edit flows, commit changes.
2. Create bare project on gitlab.
3. Add gitlab repo as a remote to your NR project.
4. Push changes.

It simply depends on whether you end up hitting an edge case or other situation the code doesn't cope with.

Nick



Shashank

unread,
Feb 2, 2018, 4:55:28 AM2/2/18
to Node-RED
Hi,

I have tried following your steps but still unable to commit to GitLab repo. Please find the screenshot below

When I click on push button nothing happens, Also, there is nothing populated in the logs. Please look into this issue.

Nick O'Leary

unread,
Feb 2, 2018, 5:15:09 AM2/2/18
to Node-RED Mailing List
In your settings.js file please can you set the logging level to 'trace' and restart Node-RED. That will log the individual git commands being run.

Also, please check the browsers javascript console for any error messages.

Nick

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Shashank

unread,
Feb 2, 2018, 5:54:01 AM2/2/18
to Node-RED
Please find my logs when set to trace. Please note that I have mocked confidential data using <<>>

1517568401965 undefined
2 Feb 04:46:41 - [info] Node-RED version: v0.18.0
1517568401966 undefined
2 Feb 04:46:41 - [info] Node.js  version: v6.11.3
1517568401966 undefined
2 Feb 04:46:41 - [info] Linux 3.10.0-693.2.2.el7.x86_64 x64 LE
1517568401966 undefined
2 Feb 04:46:42 - [info] Loading palette nodes
1517568402312 undefined
2 Feb 04:46:43 - [warn] ------------------------------------------------------
1517568403559 undefined
2 Feb 04:46:43 - [warn] [node-red/rpi-gpio] Info : Ignoring Raspberry Pi specific node
1517568403560 undefined
2 Feb 04:46:43 - [warn] ------------------------------------------------------
1517568403560 undefined
2 Feb 04:46:43 - [info] Settings file  : <<User SettingsFile>>
1517568403560 undefined
2 Feb 04:46:43 - [info] User directory : <<User Directory>>
1517568403561 undefined
2 Feb 04:46:43 - [trace] git["remote","-v"]
1517568403567 undefined
2 Feb 04:46:43 - [trace] git["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"]
1517568403578 undefined
2 Feb 04:46:43 - [info] Server now running at http://127.0.0.1:1880/
1517568403597 undefined
2 Feb 04:46:43 - [trace] git["rev-list","HEAD","--count"]
1517568403603 undefined
2 Feb 04:46:43 - [trace] git["ls-files","--cached","--others","--exclude-standard"]
1517568403612 undefined
2 Feb 04:46:43 - [trace] git["status","--porcelain","-b"]
1517568403620 undefined
2 Feb 04:46:43 - [info] Active project : NodeRedTest
1517568403631 undefined
2 Feb 04:46:43 - [info] Flows file     : <<UserDirectory>>/.node-red/projects/NodeRedTest/flow.json
1517568403631 undefined
2 Feb 04:46:43 - [debug] loaded flow revision: 97b014cab594df3e8fa81228e6b5a236
1517568403634 undefined
2 Feb 04:46:43 - [debug] red/runtime/nodes/credentials.load : using active project key - disabled
1517568403636 undefined
2 Feb 04:46:43 - [debug] red/runtime/nodes/credentials.load : keyType=disabled
1517568403636 undefined
2 Feb 04:46:43 - [trace] runtime event: {"id":"runtime-state","retain":true}
1517568403636 undefined
2 Feb 04:46:43 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"97b014cab594df3e8fa81228e6b5a236"},"retain":true}
1517568403643 undefined
2 Feb 04:46:43 - [info] Starting flows
1517568403644 undefined
2 Feb 04:46:43 - [debug] red/nodes/flows.start : starting flow : global
1517568403644 undefined
2 Feb 04:46:43 - [debug] red/nodes/flows.start : starting flow : cefab2aa.1e713
1517568403645 undefined
2 Feb 04:46:43 - [trace] runtime event: {"id":"runtime-state","retain":true}
1517568403653 undefined
2 Feb 04:46:43 - [info] Started flows
1517568403654 undefined
2 Feb 04:47:04 - [trace] git["rev-list","HEAD","--count"]
1517568424844 undefined
2 Feb 04:47:04 - [trace] git["log","--format=sha: %H%nparents: %p%nrefs: %D%nauthor: %an%ndate: %ct%nsubject: %s%n-----","-n 20"]
1517568424850 undefined
2 Feb 04:47:04 - [trace] git["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"]
1517568424860 undefined
2 Feb 04:47:04 - [trace] git["rev-list","HEAD","--count"]
1517568424871 undefined
2 Feb 04:47:04 - [trace] git["ls-files","--cached","--others","--exclude-standard"]
1517568424883 undefined
2 Feb 04:47:04 - [trace] git["status","--porcelain","-b"]
1517568424893 undefined
2 Feb 04:47:12 - [trace] git["add","flow.json"]
1517568432540 undefined
2 Feb 04:47:12 - [trace] git["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"]
1517568432611 undefined
2 Feb 04:47:12 - [trace] git["rev-list","HEAD","--count"]
1517568432619 undefined
2 Feb 04:47:12 - [trace] git["ls-files","--cached","--others","--exclude-standard"]
1517568432626 undefined
2 Feb 04:47:12 - [trace] git["status","--porcelain","-b"]
1517568432635 undefined
2 Feb 04:47:21 - [trace] git["-c","user.email=\"<<Email>>\"","-c","user.name=\"Shashank\"","commit","-m","IntialCommit"]
1517568441806 undefined
2 Feb 04:47:21 - [trace] git["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"]
1517568441835 undefined
2 Feb 04:47:21 - [trace] git["rev-list","HEAD","--count"]
1517568441870 undefined
2 Feb 04:47:21 - [trace] git["ls-files","--cached","--others","--exclude-standard"]
1517568441878 undefined
2 Feb 04:47:21 - [trace] git["status","--porcelain","-b"]
1517568441884 undefined
2 Feb 04:47:22 - [trace] git["rev-list","HEAD","--count"]
1517568442313 undefined
2 Feb 04:47:22 - [trace] git["log","--format=sha: %H%nparents: %p%nrefs: %D%nauthor: %an%ndate: %ct%nsubject: %s%n-----","-n 20"]
1517568442317 undefined
2 Feb 04:47:22 - [trace] git["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"]
1517568442325 undefined
2 Feb 04:47:22 - [trace] git["rev-list","HEAD","--count"]
1517568442335 undefined
2 Feb 04:47:22 - [trace] git["ls-files","--cached","--others","--exclude-standard"]
1517568442343 undefined
2 Feb 04:47:22 - [trace] git["status","--porcelain","-b"]
1517568442348 undefined
2 Feb 04:47:31 - [trace] git["fetch","NodeGit"]
1517568451830 undefined
2 Feb 04:47:31 - [trace] git["branch","-vv","--no-color","-r"]
1517568451891 undefined
2 Feb 04:47:44 - [trace] git["push","-u","NodeGit","HEAD:Node","--porcelain"]
1517568464621 undefined

Nick O'Leary

unread,
Feb 2, 2018, 5:59:22 AM2/2/18
to Node-RED Mailing List
Hi,

so I assume, because you don't say, that log takes you up to the point of clicking the Push button?

We can see the git push command has been issued... the question is what the response was.

Are there are errors in your browser's javascript console?

Nick

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Shashank

unread,
Feb 2, 2018, 6:02:57 AM2/2/18
to Node-RED
Yes Nick, Below is the message when checked in JavaScript console

vendor.js:5 POST http://<<IPAddress>>:1880/projects/NodeRedTest/push/NodeGit/Node?u=true 400 (Bad Request)
red.min.js:16 
{error: "unexpected_error", message: "Error: error: Missing value for 'credential.helper'↵fatal: unable to parse command-line config↵"}

Nick O'Leary

unread,
Feb 2, 2018, 6:10:32 AM2/2/18
to Node-RED Mailing List
Thanks for that.

Can you tell me what version of the git command you have installed? what does `git --version` return?

Nick

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Shashank

unread,
Feb 2, 2018, 6:15:55 AM2/2/18
to Node-RED
It returns git version 1.8.3.1

Nick O'Leary

unread,
Feb 2, 2018, 6:18:30 AM2/2/18
to Node-RED Mailing List
Ok - I think that's the problem. We require git 2.x so you'll need to update your git client.

Currently we just check the git command exists, but I'll look at adding a check on the version number so we can provide an appropriate log message.

Nick

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Shashank

unread,
Feb 2, 2018, 6:21:10 AM2/2/18
to Node-RED
Sure let me update git version and give a try. Thank you for all the help!!

Shashank

unread,
Feb 2, 2018, 6:33:06 AM2/2/18
to Node-RED
I am getting a different error now.

vendor.js:5 POST http://<<IPAddress>>:1880/projects/NodeRedTest/push/NodeGitUpdated/GitNodeN?u=true 400 (Bad Request)
send @ vendor.js:5
ajax @ vendor.js:5
r @ red.min.js:16
(anonymous) @ red.min.js:16
dispatch @ vendor.js:4
r.handle @ vendor.js:4
{error: "unexpected_error", message: "Error: fatal: could not read Password for 'http://…<<domainname>': No such device or address↵"}

How to configure the username and password for GitLab repo?

Nick O'Leary

unread,
Feb 2, 2018, 6:44:41 AM2/2/18
to Node-RED Mailing List
Hi - are you on the slack team? It may be easier to work through this in a slack conversation rather than the mailing list.

We spot authentication failures so we can prompt the user in the editor to provide credentials. The text "Error: fatal: could not read Password" is not on the list of errors that trigger an authentication challenge, but "Error: fatal: could not read Username" is.  I would like to understand why I've never seen that in my testing.

My theory is you've included your git username in the http url of the remote you've configured. Is that the case? Would you mind sharing with me privately (nick....@gmail.com) the full url of your remote? That would help me understand your usage.

If this theory is right, then if you add a new remote using the url without username, it should work.

In the meantime, I will add this message to our list of auth failure messages.

Thanks for continuing with this... I think you've been slightly unlucky to hit these edge cases, but you are definitely helping us improve projects for everyone!

Nick

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
Reply all
Reply to author
Forward
0 new messages