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

Problems with project function in adapter 2.0.0 #117

Open
mickym2 opened this issue Jul 12, 2020 · 14 comments
Open

Problems with project function in adapter 2.0.0 #117

mickym2 opened this issue Jul 12, 2020 · 14 comments

Comments

@mickym2
Copy link
Contributor

mickym2 commented Jul 12, 2020

Since update of the adapter, it seems that the git settings are no longer available and I cannot write specific states of my flows.

A dialogue says that an unexpected error has occurred and I need to specify the git user settings in node red globally.

Screenshots are available in my thread in the iobroker forum:
Node-Red 2.0.0 - keine Systemobjekte u. andere Probleme

@Sineos
Copy link

Sineos commented Jul 22, 2020

Same issue here. When comitting, I get the error:

Your Git client is not configured with a username/email.

although it is. My second NR instance v1.1.2 is working. Log shows nothing also on debug setting

@mickym2
Copy link
Contributor Author

mickym2 commented Aug 26, 2020

Any news?

@stale
Copy link

stale bot commented Nov 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions.
Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

@stale stale bot added the wontfix label Nov 25, 2020
@mickym2
Copy link
Contributor Author

mickym2 commented Nov 27, 2020

The problem still exists!!!! (see here in German - in iobroker Forum)

@stale stale bot removed the wontfix label Nov 27, 2020
@bjoernbusch
Copy link

When I manually create the .gitconfig file under the iobroker user, the feature seems to work fine. I'm not sure why it has been working fine in previous versions.

@mickym2
Copy link
Contributor Author

mickym2 commented Feb 3, 2021

So for all - with the great help of @bjoernbusch this issue can closed - with the following workarround:

Here a short description how a .gitconfig file can be created.

sudo -su iobroker

git config --global user.email "mail@maildomain"
git config --global user.name "name"

Many thanks to you @bjoernb. I waited for this solution since several months - and that someone comprehends this issue.

.gitconfig file looks like this

[user]
        email = mail@maildomain
        name = name

@mickym2 mickym2 closed this as completed Feb 3, 2021
@mickym2 mickym2 reopened this Feb 3, 2021
@mickym2
Copy link
Contributor Author

mickym2 commented Feb 3, 2021

I reopened - as I guess that the project function should be fixed in general - even if the solution above works perfect.

@Apollon77
Copy link
Contributor

How we should fix it? I'm not sure that it makes sense that we initialize a git thing, or!?

Anyone has a proposal?

@Sineos
Copy link

Sineos commented Mar 7, 2021

I do not really know what is going wrong but on a bare metal Node-Red when creating a project following happens:

  • A git repository is initialized and the flow is copied to the git folder
  • the file .config.users.json is modified in the .node-red folder, which contains the git email and name

.config.users.json

{
    "_": {
        "editor": {
            "view": {
                "view-grid-size": "20",
                "view-node-status": true,
                "view-show-tips": true,
                "view-snap-grid": true,
                "view-show-grid": true,
                "view-node-show-label": true
            },
            "context": {
                "flowRefresh": false
            }
        },
        "menu-deploymenu-item-flow": false,
        "menu-deploymenu-item-full": true,
        "git": {
            "user": {
                "name": "Sineos",
                "email": "[email protected]"
            }
        }
    }
}

So usually no intervention should be needed.

@mickym2
Copy link
Contributor Author

mickym2 commented Mar 7, 2021

The solution is in my opinion "simple" - so I do not know if it simple or not. ;) Before version 2 the git configuration seems to be not relevant or a standard config was used - whatever this means (empty name and email).

Since version 2 it is necessary to specify git user name and email. If modifying the .config.users.json will solve the problem as well I cannot confirm, but what definetly helped was the actions posted on 3rd of February.

The solution should work when the dialogue is filled out.

So with version 2 and activation of the project function caused the following error:

An unexpected error has occurred - specify the git user settings in node red globally.

So I switched to the global dialog and filled out name and email - but the problem still remains until @bjoernbusch helped me. :)

screen

And the solution should be:
If I fill out this dialogue then either .config.users.json file should be modified ( I never tested that) - or what works for me is that the 2 commands

git config --global user.email "mail@maildomain"
git config --global user.name "name"

will be executed or the appropiate .gitconfig file (see posting 3rd Feb.) in the /home/iobroker directory is created.

At the moment filling out the dialogue - is either not executed or does not perform the appropiate actions.

@lippoliv
Copy link

Still exists. Synology DS918+, iobroker as Docker with this adapter.

#117 (comment) helped me, I used UI to create a "bash terminal" and then run the three commands. After that, it worked fine.

@mickym2
Copy link
Contributor Author

mickym2 commented Aug 10, 2021

Ok I found the config.users.json. In iobroker it seems that the file is located under:
/opt/iobroker/iobroker-data/node-red

It seems that the git entries are empty in this file.

I tried to recreate this error, but seems not be possible, if it works once.

So solution may be is either executing the commands when the dialogue is opened or to change the git settings in the config.users.json file under /opt/iobroker/iobroker-data/node-red

@Apollon77
Copy link
Contributor

SI in fact would be more a topic for the readme on "how to set up manually"?

@mickym2
Copy link
Contributor Author

mickym2 commented Mar 9, 2022

Hmm I do not really understand - why it is not possible to execute both commands when the dialogue is filled out by the user or the .gitconfig file is created.
If this is not possible as original Node Red Code has to be rewritten - then for sure it needs to be a note somewhere how to enable the project function. In this case the necessary steps can be linked into the Node-Red adapter configuration near the option to enable the project function.

In this case in my opinion it would be the best way - if a user activates the project function in the adapters config

image

Both fields could be made available in the adapter config page as well

image

Then if the adapter config is committed both github commands can be executed:

git config --global user.email "mail@maildomain"
git config --global user.name "name"

In this case the dialogue in NodeRed remains still empty - but to use the project function without errors the necessary
.gitconfig file is created in the iobrokers home directory:

image

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

No branches or pull requests

5 participants