Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Stas Malyshev
Hi!

> So, if I start a fresh MediaWiki Vagrant installation, and the vagrant ssh
> into the virtual machine, the fastest way to reproduce the issue is to
> start hhvmsh and type
> 
> function f():int { return 1; };

Suspicion: HHVM thinks "int" is a class name, not primitive type name.
Not sure why though...

-- 
Stas Malyshev
smalys...@wikimedia.org

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Chad
On Mon, Apr 17, 2017 at 2:07 PM Gergo Tisza  wrote:

> On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić 
> wrote:
>
> > Value returned from function f() must be of type int, int given
>
>
> Have you enabled PHP7 mode
> ?
>
>
I'm curious if we should enable this in Vagrant and our Jenkins testing so
we can avoid weird failures that spawned this thread.

-Chad
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Chad
On Mon, Apr 17, 2017 at 3:07 PM Denny Vrandečić  wrote:

> Ah, that's a good point! Sorry, stupid error.
>
> I think I did it now - adding to
> mediawiki-vagrant/puppet/hieradata/common.yaml (I hope that is the right
> approach).
>
> Now I get the following error, which seems unrelated to my extension. Hm.
>
> Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #033[0m#033[22;31m[Mon Apr
> 17 21:48:57 2017] [hphp] [29575:7ff81f7ff700:1:02] [] Exception handler
> threw an object exception: TypeError: Argument 5 passed to pfsockopen()
> must be an instance of float, int given in
> /vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233
>
>
That almost sounds like we should be casting the input to
RedisConnectionPool
to a float from an int. If it expects floats, easy enough to provide
one...could just
check with ctype_digit() so we can handle ints and strings that look like
numbers.

And probably throw an exception if we're not, it's probably bogus config or
a bug
if we're looking at non-numeric input.

-Chad
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Denny Vrandečić
Ah, that's a good point! Sorry, stupid error.

I think I did it now - adding to
mediawiki-vagrant/puppet/hieradata/common.yaml (I hope that is the right
approach).

Now I get the following error, which seems unrelated to my extension. Hm.

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #033[0m#033[22;31m[Mon Apr
17 21:48:57 2017] [hphp] [29575:7ff81f7ff700:1:02] [] Exception handler
threw an object exception: TypeError: Argument 5 passed to pfsockopen()
must be an instance of float, int given in
/vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: Stack trace:

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #0
/vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php(233):
Redis->pconnect()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #1
/vagrant/mediawiki/includes/libs/objectcache/RedisBagOStuff.php(354):
RedisConnectionPool->getConnection()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #2
/vagrant/mediawiki/includes/libs/objectcache/RedisBagOStuff.php(151):
RedisBagOStuff->getConnection()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #3
/vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(304):
RedisBagOStuff->getMulti()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #4
/vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(251):
WANObjectCache->getMulti()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #5
/vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(948):
WANObjectCache->get()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #6
/vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(895):
WANObjectCache->doGetWithSetCallback()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #7
/vagrant/mediawiki/includes/user/User.php(515):
WANObjectCache->getWithSetCallback()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #8
/vagrant/mediawiki/includes/user/User.php(445): User->loadFromCache()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #9
/vagrant/mediawiki/includes/user/User.php(409): User->loadFromId()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #10
/vagrant/mediawiki/includes/session/UserInfo.php(88): User->load()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #11
/vagrant/mediawiki/includes/session/CookieSessionProvider.php(119):
MediaWiki\Session\UserInfo::newFromId()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #12
/vagrant/mediawiki/includes/session/SessionManager.php(487):
MediaWiki\Session\CookieSessionProvider->provideSessionInfo()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #13
/vagrant/mediawiki/includes/session/SessionManager.php(190):
MediaWiki\Session\SessionManager->getSessionInfoForRequest()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #14
/vagrant/mediawiki/includes/WebRequest.php(735):
MediaWiki\Session\SessionManager->getSessionForRequest()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #15
/vagrant/mediawiki/includes/user/User.php(1143): WebRequest->getSession()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #16
/vagrant/mediawiki/includes/user/User.php(384): User->loadDefaults()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #17
/vagrant/mediawiki/includes/user/User.php(5225): User->load()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #18
/vagrant/mediawiki/includes/user/User.php(2847): User->loadOptions()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #19
/vagrant/mediawiki/includes/context/RequestContext.php(364):
User->getOption()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #20
/vagrant/mediawiki/includes/Message.php(380): RequestContext->getLanguage()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #21
/vagrant/mediawiki/includes/Message.php(1257): Message->getLanguage()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #22
/vagrant/mediawiki/includes/Message.php(842): Message->fetchMessage()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #23
/vagrant/mediawiki/includes/Message.php(934): Message->toString()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #24
/vagrant/mediawiki/includes/exception/MWExceptionRenderer.php(244):
Message->text()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #25
/vagrant/mediawiki/includes/exception/MWExceptionRenderer.php(179):
MWExceptionRenderer::msg()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #26
/vagrant/mediawiki/includes/exception/MWExceptionRenderer.php(50):
MWExceptionRenderer::reportHTML()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #27
/vagrant/mediawiki/includes/exception/MWExceptionHandler.php(74):
MWExceptionRenderer::output()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #28
/vagrant/mediawiki/includes/exception/MWExceptionHandler.php(140):
MWExceptionHandler::report()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #29 ():
MWExceptionHandler::handleException()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #30 {main}

On Mon, Apr 17, 2017 at 2:07 PM Gergo Tisza  wrote:

> On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić 
> wrote:
>
> > 

[Wikitech-l] Issue loading JS with ResourceLoader but not with addScript

2017-04-17 Thread James Montalvo
I'm having an issue with getting ResourceLoader to properly load the
Masonry library [1]. This issue was not present on MW 1.25 but is on MW
1.27. If I do the following:

$out->addModules( 'ext.masonrymainpage.libs' ); // or as dependency to base
$out->addModules( 'ext.masonrymainpage.base' );

Then I get the following error in my browser:

Uncaught Error: Module "jquery" is not loaded.
at require
(load.php?debug=true=en=jquery%2Cmediawiki=scripts=vector=ciafJ7Ly:12581)
at masonry.pkgd.js?c5dde:29
at masonry.pkgd.js?c5dde:39
require @
load.php?debug=true=en=jquery%2Cmediawiki=scripts=vector=ciafJ7Ly:12581
(anonymous) @ masonry.pkgd.js?c5dde:29
(anonymous) @ masonry.pkgd.js?c5dde:39
load.php?debug=true=en=jquery%2Cmediawiki=scripts=vector=ciafJ7Ly:11145
Use of "wgCategories" is deprecated. Use mw.config instead.
get @
load.php?debug=true=en=jquery%2Cmediawiki=scripts=vector=ciafJ7Ly:11145
(anonymous) @
load.php?debug=true=en=site=scripts=vector=680c78b07fb0:273

However, if I load Masonry not from the ext.masonrymainpage.libs module,
but instead using OutputPage::addScript() then I have no issues:

global $wgServer, $wgExtensionAssetsPath;
$scriptURL =
"$wgServer/$wgExtensionAssetsPath/MasonryMainPage/masonry.pkgd.js";
$out->addScript( "" );
$out->addModules( 'ext.masonrymainpage.base' );

Can anyone help me figure out how to do this the right way?

Thanks,
James

[1] https://github.com/desandro/masonry
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Gergo Tisza
On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić 
wrote:

> Value returned from function f() must be of type int, int given


Have you enabled PHP7 mode
?
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Denny Vrandečić
The same works with bool too. I am glad I don't have to write (bool)true :)

On Mon, Apr 17, 2017 at 1:19 PM Denny Vrandečić  wrote:

> Hm. If I try it in https://3v4l.org/WOTg0 I actually get good behavior
> for HHMV 3.12.14 - so it might be something problematic with our deployed
> HHMV version?
>
>
> On Mon, Apr 17, 2017 at 1:16 PM Denny Vrandečić 
> wrote:
>
>> Thanks for the suggestion, but I get exactly the same error message when
>> I try to typecast the 1 to int first.
>>
>> ‪On Mon, Apr 17, 2017 at 11:56 AM ‫יגאל חיטרון‬‎ 
>> wrote:‬
>>
>>> I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
>>> Igal
>>>
>>> On Apr 17, 2017 21:36, "Denny Vrandečić"  wrote:
>>>
>>> > I'm running into a weird problem, which made me reset my whole vagrant.
>>> >
>>> > I assume this is not strictly a MediaWiki issue, but probably an HHVM
>>> > problem, but maybe someone can help me here.
>>> >
>>> > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
>>> ssh
>>> > into the virtual machine, the fastest way to reproduce the issue is to
>>> > start hhvmsh and type
>>> >
>>> > function f():int { return 1; };
>>> >
>>> > =f()
>>> >
>>> > I get:
>>> >
>>> > Hit fatal : Value returned from function f() must be of type int, int
>>> given
>>> >
>>> > #0 at [:1]
>>> >
>>> > #1 f(), called at [:1]
>>> >
>>> > #2 include(), called at [:1]
>>> >
>>> >
>>> > Any way to circumvent this (besides getting rid of the type hint,
>>> > obviously)? Update to a new HHVM version (According to
>>> Special:Version, the
>>> > HHMV version is 3.12.14 (srv)?
>>> > ___
>>> > Wikitech-l mailing list
>>> > Wikitech-l@lists.wikimedia.org
>>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>> ___
>>> Wikitech-l mailing list
>>> Wikitech-l@lists.wikimedia.org
>>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Denny Vrandečić
Hm. If I try it in https://3v4l.org/WOTg0 I actually get good behavior for
HHMV 3.12.14 - so it might be something problematic with our deployed HHMV
version?


On Mon, Apr 17, 2017 at 1:16 PM Denny Vrandečić  wrote:

> Thanks for the suggestion, but I get exactly the same error message when I
> try to typecast the 1 to int first.
>
> ‪On Mon, Apr 17, 2017 at 11:56 AM ‫יגאל חיטרון‬‎ 
> wrote:‬
>
>> I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
>> Igal
>>
>> On Apr 17, 2017 21:36, "Denny Vrandečić"  wrote:
>>
>> > I'm running into a weird problem, which made me reset my whole vagrant.
>> >
>> > I assume this is not strictly a MediaWiki issue, but probably an HHVM
>> > problem, but maybe someone can help me here.
>> >
>> > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
>> ssh
>> > into the virtual machine, the fastest way to reproduce the issue is to
>> > start hhvmsh and type
>> >
>> > function f():int { return 1; };
>> >
>> > =f()
>> >
>> > I get:
>> >
>> > Hit fatal : Value returned from function f() must be of type int, int
>> given
>> >
>> > #0 at [:1]
>> >
>> > #1 f(), called at [:1]
>> >
>> > #2 include(), called at [:1]
>> >
>> >
>> > Any way to circumvent this (besides getting rid of the type hint,
>> > obviously)? Update to a new HHVM version (According to Special:Version,
>> the
>> > HHMV version is 3.12.14 (srv)?
>> > ___
>> > Wikitech-l mailing list
>> > Wikitech-l@lists.wikimedia.org
>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>> ___
>> Wikitech-l mailing list
>> Wikitech-l@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread יגאל חיטרון
)-:

On Apr 17, 2017 23:16, "Denny Vrandečić"  wrote:

> Thanks for the suggestion, but I get exactly the same error message when I
> try to typecast the 1 to int first.
>
> ‪On Mon, Apr 17, 2017 at 11:56 AM ‫יגאל חיטרון‬‎ 
> wrote:‬
>
> > I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
> > Igal
> >
> > On Apr 17, 2017 21:36, "Denny Vrandečić"  wrote:
> >
> > > I'm running into a weird problem, which made me reset my whole vagrant.
> > >
> > > I assume this is not strictly a MediaWiki issue, but probably an HHVM
> > > problem, but maybe someone can help me here.
> > >
> > > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
> > ssh
> > > into the virtual machine, the fastest way to reproduce the issue is to
> > > start hhvmsh and type
> > >
> > > function f():int { return 1; };
> > >
> > > =f()
> > >
> > > I get:
> > >
> > > Hit fatal : Value returned from function f() must be of type int, int
> > given
> > >
> > > #0 at [:1]
> > >
> > > #1 f(), called at [:1]
> > >
> > > #2 include(), called at [:1]
> > >
> > >
> > > Any way to circumvent this (besides getting rid of the type hint,
> > > obviously)? Update to a new HHVM version (According to Special:Version,
> > the
> > > HHMV version is 3.12.14 (srv)?
> > > ___
> > > Wikitech-l mailing list
> > > Wikitech-l@lists.wikimedia.org
> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Denny Vrandečić
Thanks for the suggestion, but I get exactly the same error message when I
try to typecast the 1 to int first.

‪On Mon, Apr 17, 2017 at 11:56 AM ‫יגאל חיטרון‬‎  wrote:‬

> I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
> Igal
>
> On Apr 17, 2017 21:36, "Denny Vrandečić"  wrote:
>
> > I'm running into a weird problem, which made me reset my whole vagrant.
> >
> > I assume this is not strictly a MediaWiki issue, but probably an HHVM
> > problem, but maybe someone can help me here.
> >
> > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
> ssh
> > into the virtual machine, the fastest way to reproduce the issue is to
> > start hhvmsh and type
> >
> > function f():int { return 1; };
> >
> > =f()
> >
> > I get:
> >
> > Hit fatal : Value returned from function f() must be of type int, int
> given
> >
> > #0 at [:1]
> >
> > #1 f(), called at [:1]
> >
> > #2 include(), called at [:1]
> >
> >
> > Any way to circumvent this (besides getting rid of the type hint,
> > obviously)? Update to a new HHVM version (According to Special:Version,
> the
> > HHMV version is 3.12.14 (srv)?
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-17 Thread יגאל חיטרון
I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
Igal

On Apr 17, 2017 21:36, "Denny Vrandečić"  wrote:

> I'm running into a weird problem, which made me reset my whole vagrant.
>
> I assume this is not strictly a MediaWiki issue, but probably an HHVM
> problem, but maybe someone can help me here.
>
> So, if I start a fresh MediaWiki Vagrant installation, and the vagrant ssh
> into the virtual machine, the fastest way to reproduce the issue is to
> start hhvmsh and type
>
> function f():int { return 1; };
>
> =f()
>
> I get:
>
> Hit fatal : Value returned from function f() must be of type int, int given
>
> #0 at [:1]
>
> #1 f(), called at [:1]
>
> #2 include(), called at [:1]
>
>
> Any way to circumvent this (besides getting rid of the type hint,
> obviously)? Update to a new HHVM version (According to Special:Version, the
> HHMV version is 3.12.14 (srv)?
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Security fix for Flow Nuke integration

2017-04-17 Thread Matthew Flaschen

On 04/17/2017 12:37 AM, Matthew Flaschen wrote:

This affects your wiki if you are using both Flow and Nuke.

We recently fixed https://phabricator.wikimedia.org/T162621 , an issue
with Flow's Nuke integration.

This has now been merged to master as well as the two supported Flow
release branches (1.27 and 1.28):

master - https://gerrit.wikimedia.org/r/#/c/348407/ (merged)
1.27 - https://gerrit.wikimedia.org/r/#/c/348408/1
1.28 - https://gerrit.wikimedia.org/r/#/c/348409/1


They are now all merged, so you can (and should) update normally.

Thanks,

Matt Flaschen

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] "must be of type int, int given"

2017-04-17 Thread Denny Vrandečić
I'm running into a weird problem, which made me reset my whole vagrant.

I assume this is not strictly a MediaWiki issue, but probably an HHVM
problem, but maybe someone can help me here.

So, if I start a fresh MediaWiki Vagrant installation, and the vagrant ssh
into the virtual machine, the fastest way to reproduce the issue is to
start hhvmsh and type

function f():int { return 1; };

=f()

I get:

Hit fatal : Value returned from function f() must be of type int, int given

#0 at [:1]

#1 f(), called at [:1]

#2 include(), called at [:1]


Any way to circumvent this (besides getting rid of the type hint,
obviously)? Update to a new HHVM version (According to Special:Version, the
HHMV version is 3.12.14 (srv)?
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l