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

Fix "Uninitialized string offset: 0 at Node.php" #11465

Closed
wants to merge 1 commit into from
Closed

Conversation

enoch85
Copy link
Member

@enoch85 enoch85 commented Sep 29, 2018

Signed-off-by: Daniel Hansson daniel@hanssonit.se

Add the suggested fix in #10262 which without this fix spams the log with Uninitialized string offset: 0 at Node.php#290

cc @MorrisJobke

Signed-off-by: Daniel Hansson <daniel@hanssonit.se>
enoch85 pushed a commit that referenced this pull request Sep 29, 2018
Signed-off-by: Daniel Hansson daniel@hanssonit.se
@enoch85
Copy link
Member Author

enoch85 commented Sep 29, 2018

Backport stable 14: #11466

@enoch85
Copy link
Member Author

enoch85 commented Sep 29, 2018

Backport stable 13 #11467

@enoch85 enoch85 requested a review from MorrisJobke September 29, 2018 20:47
@MorrisJobke
Copy link
Member

Backport stable 14: #11466

Only do back ports once they are requested. And please use descriptive issue titles, because "fix #10262" doesn't help anybody. That should be within the description of the PR.

This was referenced Sep 30, 2018
@@ -284,7 +284,7 @@ public function getName() {
* @return string
*/
protected function normalizePath($path) {
if ($path === '' or $path === '/') {
if (!$path || $path === '' or $path === '/') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hiding the symptoms and not fixing the cause. The function is called with null even if only string should be handed in into this method. Thus the root cause it to search somewhere else. Could you first try the patch from #10262 (comment) to find it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solved my problem and my log isn't spammed anymore on 14.0.1. I'm no PHP developer so I don't have a clue what this does, just trying to help out here since a PR was requested with the fix in the original issue. 👼

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure it solved the symptoms, but still we should not hide them but actually look why it is happening. THat's the reason I asked you to apply the patch, because it logs actually useful information that I or any other developer could use then to properly analyze the problem. 😉

@enoch85
Copy link
Member Author

enoch85 commented Sep 30, 2018

@MorrisJobke Gotcha! Will edit the original post.

@enoch85 enoch85 changed the title fix #10262 Fix "Uninitialized string offset: 0 at Node.php" Sep 30, 2018
@enoch85
Copy link
Member Author

enoch85 commented Sep 30, 2018

Feel free to close this and fix the cause of the issue. I want clean logs, but at the same time I totally get that we should fix the the cause.

@MorrisJobke MorrisJobke closed this Oct 1, 2018
@MorrisJobke MorrisJobke deleted the fix-10262 branch October 1, 2018 07:58
@enoch85
Copy link
Member Author

enoch85 commented Oct 1, 2018

OK, so I should add this instead:

		if ($path === null) {
			\OC::$server->getLogger()->logException(new \Exception(), ['app' => 'debug-empty-path']);
			return '/';
		}

@MorrisJobke
Copy link
Member

@enoch85 Correct 👍

@MorrisJobke
Copy link
Member

It will for now do the same, but also log some stack trace. You could remove the line with the logger once you have some stack traces.

@enoch85
Copy link
Member Author

enoch85 commented Oct 1, 2018

You could remove the line with the logger once you have some stack traces.

Oh! I thought that was the fix. :D

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

Successfully merging this pull request may close these issues.

2 participants