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

Error after installing (Kirby 3) with PHP < 7.3 #53

Closed
malvese opened this issue Feb 5, 2019 · 19 comments
Closed

Error after installing (Kirby 3) with PHP < 7.3 #53

malvese opened this issue Feb 5, 2019 · 19 comments

Comments

@malvese
Copy link

malvese commented Feb 5, 2019

The error message when I save a page is:

Exception: undefined
Call to a member function name() on null

I use a custom public folder setup, as described here, but it shouldn't create any problem. I also tried to move the "content" folder to its default location, but no luck.

Edit: I tried to set it up with a fresh Starterkit and get this when I save a page:

Exception: Exception
Unable to update git: Array to string conversion
@thathoff
Copy link
Owner

thathoff commented Feb 5, 2019

Hi, can you give me some more information? You’re using v3.0.0-beta.1, right? Did you install the plugin with composer? Do you have any line and file numbers of the two errors above? Thank you!

Just a wild guess: Do you have an active user in the Kirby panel? It seems that the error happens when writing the commit massage and adding the users information as git author (which is the only part where the plugin calls a name() method on an object). In your case the user object seems to be empty/null.

@malvese
Copy link
Author

malvese commented Feb 5, 2019

Thank you for your reply!
I'm indeed using v3.0.0-beta.1, installed with Composer. I don't have a line number to provide, these are the errors I get in the Panel when I try to save.
I do have a user named "admin".

@thathoff
Copy link
Owner

Did you manage to find the error in the last couple of days? I’m back from vacations so if you manage to get it working do you want to share the solution? Otherwise: Is it possible to get access to your installation / code?

@malvese
Copy link
Author

malvese commented Feb 11, 2019

I still get the same error.
Do I need to set the remote? I'm trying to use the plugin locally via MAMP, and with the default options I think it should only try to commit, not push to the remote?
I could share the code, but it really is just a fresh Starterkit, and the plugin installed with Composer as described in the Forum.

@thathoff
Copy link
Owner

I’ll try to test your starterkit setup tonight, maybe i’ll bee able to reproduce your error!

@malvese
Copy link
Author

malvese commented Apr 8, 2019

Any update on this? I just tried again and still can't get it to work.
My setup is:

  • install via composer (as explained in Kirby's official docs)
  • install GCAPC via composer as explained in the forum (though I had to specify a version composer require blankogmbh/kirby-git-commit-and-push-content:v3.0.0-beta.1 otherwise it would fail to install)
  • the remote is set on Github, with an initial commit, as explained here in the Readme.

Every time I try to save, I get an error "Exception: Exception. Unable to update git: Array to string conversion". No change is commited.
No PHP error in the console.

@malvese
Copy link
Author

malvese commented Apr 8, 2019

Update: I used PHP 7.1. I upgraded to 7.3 and the plugin now works.
Is there a known minimum version that should be documented?

Also, I noticed I had to use a URL of the kind git@github.com:user/repo.git. I couldn't get past authentication with https://github.com/user/repo.git.

@thathoff
Copy link
Owner

thathoff commented Apr 8, 2019

Sorry for not replying, I totally forgot to replay to this issue! We will definitely have a look to support PHP 7.1, this should be the minimum required version. You might also want to switch from tag v3.0.0-beta.1 to dev-kirby3 for now because this branch already contains some small fixes.

@malvese
Copy link
Author

malvese commented Apr 8, 2019

Sweet! Thank you. I switched to dev-kirby3.
You should really update the readme with all the info from the forum, it would help a lot.

FYI, I tried both 7.1 and 7.2 with dev-kirby3 and got the same error as before. For me it only works with PHP 7.3.

@thathoff
Copy link
Owner

thathoff commented Apr 8, 2019

We’ll try! :) Actually I’m waiting for feedback from Wottpal (who forked this plugin) if we should join forces on a Kirby git plugin. But have not heard from him for a couple of weeks. Because of this currently we're just doing very little development on our plugin so that we do not have to do things twice.

@thathoff thathoff changed the title Error after installing (Kirby 3) Error after installing (Kirby 3) with PHP < 7.3 Apr 8, 2019
@robinscholz
Copy link

Currently running into a similiar error

Unable to update git: fatal: could not read Username for 'https://github.com': Device not configured

A properly working version of this would be amazing!

@thathoff
Copy link
Owner

thathoff commented Jun 4, 2019

@robinscholz This seems not to be related to this issue. It seems to me that the user running your web server does not have credentials to push to the remote repository.

@malvese
Copy link
Author

malvese commented Jun 4, 2019

Could it be related to this?

Also, I noticed I had to use a URL of the kind git@github.com:user/repo.git. I couldn't get past authentication with https://github.com/user/repo.git.

@robinscholz
Copy link

@robinscholz This seems not to be related to this issue. It seems to me that the user running your web server does not have credentials to push to the remote repository.

@thathoff This happens locally, while running kirby via valet. Any idea how to solve this?

@thathoff
Copy link
Owner

thathoff commented Jun 4, 2019

Hmm, we do everything with docker here, so I don’t know the details how valet works. Does valet run the code as the local user or as an nginx user? In the latter case you might want to sudo -i -u THE_NGINX_USER and try to clone the repository as that user.

@robinscholz
Copy link

Seems to be a valet problem: laravel/valet#293

Running the plugin on a localhost server with php -S seems to be working. I'll try and figure out how to solve this once I have some more time.

@robinscholz
Copy link

Not entirely sure if this was the final fix, but adding my SSH Key to the mac keychain seemed to have worked: https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent

@foxacid
Copy link

foxacid commented Jun 17, 2019

Glad I found this. I was also getting the array to string conversion error:

Exception: Exception
Unable to update git: Array to string conversion

Upgrading to PHP 7.3 did the trick. Now on to making this work on the remote server...

@thathoff
Copy link
Owner

Since PHP versions < 7.3 are EOL i’ll close this issue.

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

No branches or pull requests

4 participants