[01:46:03] !log tools launch tools-worker-1026 [01:46:07] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/SAL [01:58:21] PROBLEM - Puppet run on tools-worker-1004 is CRITICAL: CRITICAL: 22.22% of data above the critical threshold [0.0] [02:03:29] PROBLEM - Puppet run on tools-worker-1014 is CRITICAL: CRITICAL: 44.44% of data above the critical threshold [0.0] [02:04:21] PROBLEM - Puppet run on tools-docker-builder-03 is CRITICAL: CRITICAL: 55.56% of data above the critical threshold [0.0] [02:04:25] wtf I disabled pupet [02:05:13] yuvipanda: ! [02:05:37] 's cool, they just had puppet in progress when I disabled it I think [02:07:10] PROBLEM - Puppet run on tools-worker-1026 is CRITICAL: CRITICAL: 20.00% of data above the critical threshold [0.0] [02:07:37] ^ is expected [02:09:58] PROBLEM - Puppet run on tools-worker-1003 is CRITICAL: CRITICAL: 100.00% of data above the critical threshold [0.0] [02:12:06] RECOVERY - Puppet run on tools-worker-1026 is OK: OK: Less than 1.00% above the threshold [0.0] [02:13:30] !log tools reboot tools-worker-1026 to see if it comes up fine [02:13:33] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/SAL [02:13:46] !log tools launch tools-worker-1027 to see if puppet works fine on first run! [02:13:49] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/SAL [02:23:32] PROBLEM - Puppet run on tools-docker-builder-04 is CRITICAL: CRITICAL: 55.56% of data above the critical threshold [0.0] [02:38:33] PROBLEM - Puppet run on tools-worker-1027 is CRITICAL: CRITICAL: 10.00% of data above the critical threshold [0.0] [02:40:03] 06Labs, 10Tool-Labs: User sdesabbata has no replica.my.cnf - https://phabricator.wikimedia.org/T157176#2998125 (10scfc) [02:43:35] RECOVERY - Puppet run on tools-worker-1027 is OK: OK: Less than 1.00% above the threshold [0.0] [02:45:23] Change on 12wikitech.wikimedia.org a page Nova Resource:Tools/Access Request/S.desabbata was modified, changed by Tim Landscheidt link https://wikitech.wikimedia.org/w/index.php?diff=1455737 edit summary: [02:49:57] RECOVERY - Puppet run on tools-worker-1003 is OK: OK: Less than 1.00% above the threshold [0.0] [02:54:34] PROBLEM - Puppet run on tools-worker-1027 is CRITICAL: CRITICAL: 10.00% of data above the critical threshold [0.0] [03:04:33] RECOVERY - Puppet run on tools-worker-1027 is OK: OK: Less than 1.00% above the threshold [0.0] [03:30:46] 06Labs, 10Tool-Labs, 10Prod-Kubernetes, 10Tools-Kubernetes: Unify docker code and configuration between tools and prod kubernetes - https://phabricator.wikimedia.org/T156852#2998204 (10yuvipanda) Update: No need to switch to using CNI for now! Eventually it might be a good idea tho. [03:38:37] 06Labs, 10Tool-Labs, 10Prod-Kubernetes, 10Tools-Kubernetes: Unify docker code and configuration between tools and prod kubernetes - https://phabricator.wikimedia.org/T156852#2998225 (10yuvipanda) Currently https://gerrit.wikimedia.org/r/#/c/335299/ and https://gerrit.wikimedia.org/r/#/c/335957/6 are cherry... [03:39:56] 06Labs, 10Tool-Labs, 10Prod-Kubernetes, 10Tools-Kubernetes, 07kubernetes: Set-up live-restore for docker containers - https://phabricator.wikimedia.org/T157180#2998226 (10yuvipanda) [03:40:09] 06Labs, 10Tool-Labs, 10Prod-Kubernetes, 10Tools-Kubernetes: Unify docker code and configuration between tools and prod kubernetes - https://phabricator.wikimedia.org/T156852#2998240 (10yuvipanda) Could also use this as an opportunity to do T157180 I think [03:43:15] 10Labs-project-Wikistats: Update for wikistats.wmflabs.org/display.php - https://phabricator.wikimedia.org/T157181#2998242 (10Rsterbal) [04:04:09] 10Labs-project-Wikistats: Update for wikistats.wmflabs.org/display.php - https://phabricator.wikimedia.org/T157181#2998255 (10Dzahn) a:03Dzahn [04:08:21] RECOVERY - Puppet run on tools-worker-1004 is OK: OK: Less than 1.00% above the threshold [0.0] [04:08:27] RECOVERY - Puppet run on tools-worker-1014 is OK: OK: Less than 1.00% above the threshold [0.0] [04:26:34] 06Labs, 10Tool-Labs, 10Prod-Kubernetes, 10Tools-Kubernetes, and 2 others: Set-up live-restore for docker containers - https://phabricator.wikimedia.org/T157180#2998270 (10yuvipanda) I've it turned on for the docker builder hosts, and it looks good! It still stops containers that have interactive terminals... [04:28:34] RECOVERY - Puppet run on tools-docker-builder-04 is OK: OK: Less than 1.00% above the threshold [0.0] [04:45:05] Still battling with the best way to get diffs via the mediawiki API. Any thoughts anyone? [04:53:18] enterprisey: ^^ ? [04:53:40] nobody's written a library yet? [04:53:52] enterprisey: tgr|away said they would ;p [04:54:12] hashtag https://phabricator.wikimedia.org/T157177 [04:54:14] enterprisey: ^^ [06:22:46] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2981472 (10scfc) This is an annoying bug for experienced users and can be unsurmountable for newbies. Let's make the solution to this... [07:23:48] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2998360 (10scfc) After cloning the repository and adding some `print`s, the output of `PYTHONPATH=. scripts/webservice --backend=kubern... [07:28:01] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2998375 (10scfc) (Fun fact: Starting `webservice start` from a home directory on NFS is enough to cause a sufficient delay for the bug... [07:29:26] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2998377 (10zhuyifei1999) >>! In T156626#2998360, @scfc wrote: > I. e., "Terminating" pods have `svc` and `deployment` set to `None` = t... [07:40:29] 06Labs, 10Tool-Labs, 06Developer-Relations: Provide an easy way for Tool Labs tools to expose their source code - https://phabricator.wikimedia.org/T102081#1355202 (10Legoktm) >>! In T102081#1404736, @yuvipanda wrote: > So problems with Gerrit are: > > # No self-serve repo creation / forking > # The UI is..... [07:42:27] 06Labs, 10Tool-Labs, 10labs-sprint-119, 06Community-Tech-Tool-Labs, 10Diffusion: Figure out a git hosting solution for tools/kubernetes - https://phabricator.wikimedia.org/T117071#2998385 (10Legoktm) With Striker+Diffusion, is this resolved now? [08:14:56] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2998399 (10scfc) AFAICT a "Terminating" pod has `pod.obj['status']['phase']` set to `Running`: ``` tools.typoscan@tools-bastion-03:/tm... [08:32:49] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2998402 (10scfc) AFAICT this patch works: ``` diff --git a/toollabs/webservice/backends/kubernetesbackend.py b/toollabs/webservice/bac... [08:38:08] PROBLEM - Puppet run on tools-worker-1026 is CRITICAL: CRITICAL: 50.00% of data above the critical threshold [0.0] [09:00:49] 10Labs-project-Wikistats, 07I18n: mutante's Wikistats uses the old English name of Gõychi Konknni - https://phabricator.wikimedia.org/T156814#2998418 (10The_Discoverer) Thanks everyone! [09:13:06] RECOVERY - Puppet run on tools-worker-1026 is OK: OK: Less than 1.00% above the threshold [0.0] [11:22:04] PROBLEM - High iowait on tools-webgrid-lighttpd-1413 is CRITICAL: CRITICAL: tools.tools-webgrid-lighttpd-1413.cpu.total.iowait (>11.11%) [11:24:43] 10Tool-Labs-tools-stewardbots, 07Need-volunteer, 07WorkType-NewFunctionality: Webinterface for stewardbots - https://phabricator.wikimedia.org/T157186#2998447 (10MarcoAurelio) [11:32:05] RECOVERY - High iowait on tools-webgrid-lighttpd-1413 is OK: OK: All targets OK [16:08:54] prop: revisions, rvprop: content seems to have been changed since yesterday already... https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=The+Battle+Pavane&rvprop=content&rvlimit=max [16:08:56] halfak: ^^ [16:09:07] Would a patch be on gerrit? [16:09:12] wat [16:09:47] halfak: idk if somebody started messing with the API already (after the phab ticket was filed recently for prop:revisions) [16:09:56] but it's certainly not the same... [16:10:06] That seems extremely unlikely. [16:10:48] halfak: Is it this? https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ApiFeatureUsage [16:10:48] and ok [16:10:51] JustBerry, what's the change you think happened? [16:10:53] no open projects [16:11:07] well, I made the API call for the same page and drastically different formatting [16:11:17] like https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=The+Battle+Pavane&rvprop=content&rvlimit=max [16:11:36] same JSON, completely infoless [16:12:43] halfak: same for v [16:12:47] whops, https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=The+Battle+Pavane&rvprop=content%7Cids%7Cuser%7Ccomment&rvlimit=max [16:12:50] you can change the params around [16:29:55] halfak: don't think so? [16:30:34] I don't understand what you think changed. [16:31:53] JustBerry, it looks like you're running queries on mediawiki.org that are intended for en.wikipedia.org [16:32:14] https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=The+Battle+Pavane&rvprop=content%7Cids%7Cuser%7Ccomment&rvlimit=max [16:32:21] :P [16:32:23] ... [16:32:24] 10PAWS: "404 - Not found" when I tried to access to PAWS Control Panel - https://phabricator.wikimedia.org/T140525#2467657 (10Info-farmer) PAWS works well in my main account(info-farmer) but not in my bot account(info-farmerBot) .The following error still exists. [[ https://www.mediawiki.org/wiki/Manual_talk:Py... [16:32:28] * JustBerry facepalms [16:32:40] \o/ [16:32:55] Celebrate the problems that are easy to solve :) [16:33:53] Every now and then you find a compiler bug and in the process, your lifespan is reduced by years due to the frustration and stress in dealing with an insane world. [16:34:11] I've found a few core library bugs in my time, but no compiler bugs. [16:34:25] Thankfully. [16:36:10] halfak: o/ [16:36:15] halfak: let's take a look at this though: https://phabricator.wikimedia.org/P4887 [16:36:25] from this API call: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=The+Battle+Pavane&rvprop=content%7Cids%7Cuser%7Ccomment&rvlimit=max [16:36:32] now we look at the diff [16:36:32] https://en.wikipedia.org/w/index.php?title=User:JustBerry&diff=763673305&oldid=763673231 [16:36:38] the only thing the user changed was (needs citation) [16:36:50] yet the paste I linked above gives a bunch of other info [16:36:53] which is fine [16:36:58] but doesn't actually indicate what was changed [16:38:19] https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=The+Battle+Pavane&rvprop=content%7Cids%7Cuser%7Ccomment&rvlimit=max&rvdiffto=prev [16:38:34] Regretfully, api.php outputs the diff table. [16:38:42] That's what the stuff is. [16:38:54] So depending on what you want to do, you can parse that. [16:47:28] 06Labs, 10Tool-Labs, 10labs-sprint-119, 06Community-Tech-Tool-Labs, 10Diffusion: Figure out a git hosting solution for tools/kubernetes - https://phabricator.wikimedia.org/T117071#2998614 (10bd808) >>! In T117071#2998385, @Legoktm wrote: > With Striker+Diffusion, is this resolved now? There is at least... [16:47:29] halfak: ;/ [16:47:36] bd808: online? o/ [16:48:52] 06Labs, 10Tool-Labs: Rotate mysql and k8s secrets for tools.spiarticleanalyzer - https://phabricator.wikimedia.org/T157158#2998616 (10JustBerry) @bd808 Are we good to go here? Planning on firing Flask back up. [16:59:49] 06Labs, 10Tool-Labs: Rotate mysql and k8s secrets for tools.spiarticleanalyzer - https://phabricator.wikimedia.org/T157158#2998626 (10bd808) >>! In T157158#2998616, @JustBerry wrote: > @bd808 Are we good to go here? Planning on firing Flask back up. Yup. Just don't publish your [17:01:51] 06Labs, 10Tool-Labs: Rotate mysql and k8s secrets for tools.spiarticleanalyzer - https://phabricator.wikimedia.org/T157158#2998627 (10JustBerry) @bd808 Got it. It seems as though the code should //not// be in www/python/src (only app.py and relevant files), and (instead) the script .py files should be in the h... [17:03:40] Was just gonna ping bd808 too. I was hoping to make some contribs to the simple flask/oauth demo :) [17:04:31] * bd808 rubs sleepy eyes and reads backscroll [17:04:52] bd808: o [17:04:54] bd808: o/* [17:05:11] bd808, not sure the api stuff I was working on with JustBerry is relevant to your pings [17:05:27] seems not [17:05:29] halfak: that had to do with rotating keys [17:05:38] I mean they're indirectly related [17:05:42] all has to do with the tool I'm trying to make ;p [17:05:49] one has to do with code placement/tool labs [17:05:56] one has to do with mediawiki-end (api stuff) [17:06:48] bd808: I re'ed in the ticket btw. Is that code placement kind of right? [17:06:54] just trying to get a general sense... [17:07:11] JustBerry: ? what [17:07:24] bd808: is this right https://phabricator.wikimedia.org/T157158#2998627 [17:07:28] do not commit secrets to git and publish to github [17:07:31] i know [17:07:36] talking about code placement [17:08:09] I actually do not understand the words you wrote on that ticket [17:08:23] * halfak clicks on ticket and tries to help [17:08:27] JustBerry: it's a matter of personal preference [17:08:35] zhuyifei1999_: well that's the part I don't get ;p [17:08:38] because [17:08:42] before I put them in /src [17:08:47] and it didn't work [17:08:56] so I'm trying to see am I doing it wrong or something else is wrong in the code [17:09:02] what do you mean by it doesn't work? [17:09:02] doing it wrong, i.e. placing it wrong [17:09:13] * halfak lets zhuyifei1999_ take this one [17:09:15] :) [17:09:38] whereever you place it shouldn't matter [17:09:41] zhuyifei1999_: ok... [17:09:59] * JustBerry sshes into labs [17:10:05] as long as the app.py inside src/ loads the rest of the code and use it [17:10:13] ok [17:10:35] by load I kind of mean import [17:10:48] webservice didn't work [17:10:50] and I did the venv thing [17:10:55] webservice start [17:10:56] ok [17:11:17] uh you really need to clarify what's "didn't work" [17:11:27] zhuyifei1999_: Could not find a public_html folder or a .lighttpd.conf file in your tool home. [17:11:31] eg. error message? hang? [17:11:33] did webservice start [17:11:34] in ~ [17:11:38] that's lighttpd [17:11:50] (venv)tools.spiarticleanalyzer@tools-bastion-03:~$ [17:11:52] in venv tho [17:12:03] you need to start uwsgi webservice, not lighttpd [17:12:03] I did [17:12:04] source ~/www/python/venv/bin/activate [17:12:26] webservice start defaults to lighttpd [17:12:28] zhuyifei1999_: webservice uwsgi-python start ? [17:12:29] ok [17:12:34] halfak: re: the flask + oauth demo... I've been trying to update https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/Python_application_stub and making a tool to do it as I go [17:12:51] you were using k8s right? [17:13:09] webservice uwsgi-python start is grid uwsgi python 2 webservice [17:14:16] webservice --backend=kubernetes python2 start is k8s uwsgi python2 webservice [17:15:00] bd808, do you have a repo for the tool yet? [17:15:14] switching between k8s and grid should preferably use different virtualenv, they are on different OS [17:15:26] JustBerry: ^ [17:15:44] halfak: https://phabricator.wikimedia.org/source/tool-my-first-flask-oauth-tool/ [17:16:10] my-first-flask-oauth-tool lol [17:17:21] does app.py have to be running zhuyifei1999_ [17:17:27] or can I close out of it after running it once [17:17:28] bd808, flask_mwoauth doesn't seem to perform any of the security checks we implemented in mwoauth. [17:17:32] Not sure I'd recommend it. [17:17:37] Maybe I can fix that. [17:17:59] JustBerry: what do you mean by run? it kind of runs on k8s [17:18:09] zhuyifei1999_: what do you mean [17:18:12] after that webservice start command [17:18:19] http://pythonhosted.org/mwoauth/ [17:18:29] yeah. it's giving me problems at the moment too. Was was thinking about just showing direct mwoauth usage [17:18:39] ok: more complete story: [17:18:40] not loading o/ https://tools.wmflabs.org/spiarticleanalyzer [17:18:43] zhuyifei1999_: ok [17:18:44] halfak: I use your lib in Striker :) [17:18:59] when you $ webservice --backend=kubernetes python2 start [17:19:01] :) [17:19:23] I'll see what I can do to get mwoauth used inside of flask_mwoauth. Should be easy [17:19:30] halfak: broken ;c https://tools.wmflabs.org/spiarticleanalyzer/ [17:19:33] zhuyifei1999_: ok? [17:19:33] it fires up a pod (similar to a VM, running debian) in k8s [17:19:47] I use webservice uwsgi-python start zhuyifei1999_ [17:20:15] should I use webservice --backend=kubernetes python2 start instead [17:20:28] then according to the VM's starting procedure, it opens a continuously-running uwsgi process [17:20:57] the uwsgi process imports app.py, the use the variable named app inside it [17:21:11] zhuyifei1999_: oh, so it does that when you do webservice start [17:21:15] automatically [17:21:20] I don't have to do python app.py in that dir? [17:21:24] then for each request uwsgi somehow calls app [17:21:54] app handles the request with flask logic and returns the html, and flask wraps it [17:22:16] uwsgi then return the response to the browser [17:22:30] no, you don't python app.py [17:23:06] webservice --backend=kubernetes python2 start is on k8s, which is generally faster for various reasons [17:23:41] zhuyifei1999_: aight [17:23:50] riparoni tho zhuyifei1999_ https://tools.wmflabs.org/spiarticleanalyzer/ [17:24:06] webservice uwsgi-python start is one grid, and have a simpler but older procedure for starting jobs [17:24:34] JustBerry: check your uwsgi.log in case of error like that [17:24:59] if there are no tracebacks you might want to add that [17:25:01] zhuyifei1999_: yeah, doing that now [17:25:03] removing prior logs [17:25:08] so I can get a new log for this run [17:25:20] in an error handler or with try...except [17:25:46] uh, when you remove logs, you might want to restart the webservice [17:26:04] zhuyifei1999_: i did i did [17:26:46] most log-cleaning operations are not so safe. (i.e. don't disrupt other processes that are writing to the file) [17:27:03] zhuyifei1999_: *** Python threads support is disabled. You can enable it with --enable-threads$ [17:27:23] that's irrelevant [17:27:27] brb [17:29:18] * JustBerry in comes mafk [17:29:38] * mafk hi? [17:29:47] 'ello [17:30:17] zhuyifei1999_: ping if back o/ [17:34:41] JustBerry: re [17:35:58] JustBerry: when you encounter 500s, find the log near the 500 log entry [17:36:26] usually in the last lines [17:36:42] you can try the tail command [17:37:41] especially tail -f (or -F, very similar) that follows all additions to the file [17:38:34] or less +G if you want to scroll in the file (but it doesn't follow afaik) [17:40:11] * halfak pulls his hair out looking at flask-mwoauth [17:40:49] I'm seriously considering setting up a flask router in the mwoauth library [17:41:04] halfak: :) valhallasw`vecto wrote it a long time ago I think [17:41:14] Yeah. I think it predates mwoauth by a bit [17:41:34] base_url="https://www.mediawiki.org/w" [17:41:39] ..../w" [17:41:42] base_url [17:41:56] halfak: lol [17:42:05] there's like a part of me that snaps when I see something like "base_url" with a slash and some stuff [17:42:06] I thought it uses mwoauth [17:42:22] yeah... regretfully not. [17:42:44] Maybe I can convince valhallasw`vecto to do a major version flip :) [17:43:03] I bet he would review the PR for it ;) [17:43:25] Yeah... just debating whether I continue to operate within the current scheme or do a full cleanup :) [17:43:34] * halfak works on pr [17:43:42] I don't mean to complain. This code works and supports a lot of tools :) [17:44:32] * zhuyifei1999_ forgot what video2commons uses [17:44:57] I probably reinvented the wheel [17:48:58] yo zhuyifei1999_ [17:49:38] so ^ [17:49:56] zhuyifei1999_: type error but having trouble copying the traceback ;p [17:50:22] paste to phab? [17:51:30] zhuyifei1999_: https://phabricator.wikimedia.org/P4889 [17:51:31] yeah [17:54:49] looks like something went wrong with your app.secret_key [17:55:57] zhuyifei1999_: rip [17:56:35] zhuyifei1999_: app.secret_key = f.readline().splitlines() [17:56:36] heh [17:56:43] that might be an issue? [17:56:56] can I see your app.py code? [17:57:19] uh of course [17:57:43] splitlines splits a string into a list of strings [17:58:17] zhuyifei1999_: splitlines()[0]? o/ [17:58:40] the preferred way to trim whitespace is using string.strip [17:59:26] zhuyifei1999_: think I was trimming new lines [17:59:37] whitespace = linebreaks, spaces, tabs, etc. [17:59:44] yeah [18:00:11] f.readline().strip()? [18:00:12] zhuyifei1999_: [18:00:18] yeah [18:03:16] zhuyifei1999_: it's not actually posting anything though https://tools.wmflabs.org/spiarticleanalyzer/ [18:04:55] what's your expected result? [18:07:44] JustBerry: why do you have two independent apps? https://github.com/JustBerry/SPIArticleAnalyzer/blob/master/app.py#L6 https://github.com/JustBerry/SPIArticleAnalyzer/blob/master/getAllUsers.py#L7 [18:08:20] only the former is run [18:08:36] the second is probably not even imported... [18:11:00] zhuyifei1999_: wait what [18:11:03] app.pys? [18:11:33] I shouldn't create the app or import flask at all zhuyifei1999_ [18:11:48] both of the files defined app = Flask(__name__) [18:12:03] only one of then should [18:12:06] *them [18:19:37] o/ [18:20:08] zhuyifei1999_: how can I move a repo to a parent directory [18:20:24] it'll be easier for me to commit www/python/src/app.py (only) in the repo [18:20:27] ? [18:20:37] uh [18:20:41] right now the repo is in [18:20:43] ~/X [18:20:47] if the repo comes in ~ [18:20:52] I can commit ~/X/* [18:21:00] and ~www/python/src/app.py [18:21:07] and ~/www/python/src/app.py [18:22:06] I guess you just move the .git directory to the parent dir [18:22:23] mv .git ~ zhuyifei1999_? [18:22:24] then git add, git commit [18:22:49] uh so yore going to commit your home dir? [18:23:03] you gotta be careful with that [18:23:21] zhuyifei1999_: yeah, I'm only adding certain dirs [18:23:27] ok [18:23:46] don't add the virtualenvs [18:23:53] zhuyifei1999_: btw, how do I add deleted files [18:23:59] "Changes not staged for commit:" [18:24:00] they have many files [18:24:02] ^^ [18:24:02] ok [18:24:12] add deleted files? [18:24:17] well [18:24:22] how do I "stage them for a commit" [18:24:27] git add [18:25:06] git commit -a might work as well [18:25:21] check the commit comments [18:26:29] zhuyifei1999_: shouldn't git --add work [18:26:39] git --add? [18:26:48] nope [18:26:51] wayyyy too much added [18:26:55] how do I unadd files [18:26:57] zhuyifei1999_: [18:27:12] uh [18:27:17] that one idk [18:27:21] google? [18:27:45] git reset eh [18:29:17] * zhuyifei1999_ gtg soon. for these general (non-labs-specific) questions, google is the expert [18:34:09] zhuyifei1999_: it's all labs-specific now ;p [18:38:41] zhuyifei1999_: yeah... ValueError: get() more than one object; use filter when trying to start webservice [18:38:42] ob oi [18:38:44] o boi* [18:39:03] ignore that [18:39:21] webservice --backend=kubernetes python2 start [18:39:21] Your job is already running [18:39:23] zhuyifei1999_: ^^ [18:39:27] after few minutes [18:39:29] seems stuck [18:39:37] https://phabricator.wikimedia.org/T156626 [18:39:37] webservice stop [18:39:38] Your webservice is not running [18:39:39] so [18:39:53] uh [18:40:40] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2981472 (10JustBerry) ``` webservice stop; webservice --backend=kubernetes python2 start ``` gives me ``` Your webservice is not ru... [18:40:52] last time I saw that, it was basically services.manifest resets to lighttpd after you stopped it [18:41:33] JustBerry: webservice --backend=kubernetes python2 start; sleep 2; webservice --backend=kubernetes python2 start [18:41:43] wait no [18:41:48] webservice --backend=kubernetes python2 start; sleep 2; webservice --backend=kubernetes python2 start [18:41:48] Your job is already running [18:41:48] Your job is already running [18:41:50] zhuyifei1999_: ? [18:41:55] webservice --backend=kubernetes python2 stop; sleep 2; webservice --backend=kubernetes python2 start [18:42:10] aha [18:42:11] ;p [18:42:21] it resets to lighttpd and gets extremely annoying [18:42:37] zhuyifei1999_: NameError: name 'app' is not defined [18:42:38] pfft [18:42:49] cause I deleted L7 [18:42:55] from getAllUsers.py [18:42:58] your app.py doesn't have an app [18:43:09] that means ^ [18:44:17] zhuyifei1999_: naw https://github.com/JustBerry/SPIArticleAnalyzer/blob/master/www/python/src/app.py [18:45:19] what's the traceback? [18:46:24] Traceback (most recent call last): [18:46:25] File "getAllUsers.py", line 20, in [18:46:25] @app.route("/") [18:46:26] NameError: name 'app' is not defined [18:47:50] Arg! Flask uses a JSON serializer for session stuff by default [18:47:51] WHY [18:48:14] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2998688 (10zhuyifei1999) p:05Triage>03High >>! In T156626#2998685, @JustBerry wrote: > I got the same error. Afterwards, when I did... [18:48:46] JustBerry: getAllUsers needs that app in that logic [18:49:01] zhuyifei1999_: so add back in? xD [18:49:04] halfak: why not? [18:49:19] JustBerry: add back in = two independent apps [18:49:29] not gonna work at all [18:49:30] JSON serialization doesn't have a nice pattern for encoding complex data types in python [18:49:40] zhuyifei1999_: well... [18:49:47] * JustBerry listens to zhuyifei1999_ [18:49:47] Silently turns my named tuples into plain tuples. [18:50:14] halfak: pickle has security issues... [18:50:48] JustBerry: refer to precise-data tool and video2commons :P [18:50:50] zhuyifei1999_, sure. But if I'm writing my own pickle objects in memory, I've already owned you. [18:51:30] halfak: don't you store session somewhere? [18:51:47] zhuyifei1999_, default implementation is an in-memory solution [18:51:55] for flask [18:52:07] 06Tool-Labs-standards-committee, 10Wikimedia-Mailing-lists: Create mailing list for Tool-Labs-standards-committee - https://phabricator.wikimedia.org/T156218#2998692 (10Matanya) [18:52:24] oh I thought default implementation is a signed encrypted client side session [18:52:42] in the client cookie [18:52:46] zhuyifei1999_: didn't you need an app in your main .py file? [18:52:48] i.e. the main script? [18:53:05] JustBerry: which tool? [18:53:18] zhuyifei1999_: video2commons [18:53:46] zhuyifei1999_, oh. You might not be wrong about that [18:53:54] halfak: so if your app.secret_key ever gets stolen, prepare for arbitrary code execution :P [18:54:00] Yeah... if the client is storing it, you're right to want signed/encrypted [18:54:10] JustBerry: it's imported from elsewhere [18:54:28] zhuyifei1999_: which file is your main file anyway [18:55:01] You cant' just dict() a named tuple. WHY [18:55:05] arg [18:55:29] halfak: cuz python. [18:55:32] JustBerry: there's like no "main file" in v2c [18:55:47] zhuyifei1999_: what runs when someone clicks a particular button [18:55:53] JustBerry, that's one of the types of things that python tends to get right [18:55:55] what's one of them [18:56:01] halfak: heh [18:56:15] the entry point is www/python/src/app.py, but it imports app from videocommons/frontend/app.py [18:56:20] phabricator.python.com you go halfak p [18:56:21] ;p* [18:56:34] zhuyifei1999_: what is "it" [18:57:11] the it in "it imports"? the entry point [18:57:15] zhuyifei1999_: https://github.com/toollabs/video2commons/blob/master/www/python/src/app.py#L28? [18:57:29] yeah [18:57:52] https://github.com/toollabs/video2commons/blob/master/video2commons/frontend/app.py#L44 [18:58:01] sorry this one is a complex one [18:58:04] zhuyifei1999_: video2commons.frontend isn't in /src though [18:58:18] cause you imported frontend [18:58:18] o [18:58:26] sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") [18:58:53] (might not be not the best way to do this, but I kind of need relative urls) [18:59:03] *urls => paths [18:59:43] JustBerry: you can use an absolute path since it's only on tool labs [19:00:11] zhuyifei1999_: ya aight [19:00:46] anyways, most of the fun aren't in app.py [19:01:02] It works! [19:01:15] apache? [19:01:15] OK. Just gotta do the JSON serialization dance manually :( [19:02:32] * zhuyifei1999_ thinks of apache spontaneously when I see "It works!" :P [19:02:38] zhuyifei1999_: import www/python/src/app.py? [19:02:45] problem is [19:02:46] it's [19:02:50] ~www/python/src/app.py [19:02:53] whops [19:02:55] ~/www/python/src/app.py [19:02:55] and [19:02:56] ? [19:03:05] ~/SPIArticleAnalyzer [19:03:16] ~/SPIArticleAnalyzer/.py [19:03:18] @ zhuyifei1999_ [19:03:25] ? [19:03:29] how should I import [19:03:41] import ~/www/python/src/app.py or [19:03:43] ~/www/python/src/app.py imports the rest of the code [19:03:44] ? [19:04:03] zhuyifei1999_: I just need the app [19:04:05] hm [19:04:06] how it's done is a matter of preference [19:04:57] zhuyifei1999_: ill add import ~/www/python/src/app.py here https://github.com/JustBerry/SPIArticleAnalyzer/blob/master/SPIArticleAnalyzer/getAllUsers.py#L7 [19:05:21] and if the app is defined in app.py, and app.py is importing getAllUsers.py, it'll be difficult for getAllUsers.py to use app [19:05:40] i.e. that's a loop [19:06:49] 06Labs, 10Tool-Labs, 10Tools-Kubernetes: k8s webservice restart failure with `ValueError: get() more than one object; use filter` - https://phabricator.wikimedia.org/T156626#2998713 (10JustBerry) @scfc Looks like this bug a continuing problem. If that patch works, perhaps the revision process can begin via g... [19:07:20] zhuyifei1999_: app.py is not importing getAllUsers.py, is it? [19:07:35] it's not, but it should [19:07:35] zhuyifei1999_: https://github.com/JustBerry/SPIArticleAnalyzer/blob/master/www/python/src/app.py [19:07:39] how [19:07:45] so it should be the other way around? [19:07:48] have app declared in the code [19:07:52] and have the other guy import? [19:08:09] there's no other way for app to know the rest of the code without importing them [19:08:25] well, told ya, a loop [19:08:42] remember: app.py is the entry point [19:08:49] not the exit [19:09:06] zhuyifei1999_: so where should the initialization be made then [19:09:28] enterprisey: o. [19:09:39] that's matter of preference [19:09:54] zhuyifei1999_: so basically both should import each other and one should declare the app [19:09:57] I think that's what you're saying. [19:10:09] you can't import each other [19:10:16] python doesn't allow that [19:10:50] zhuyifei1999_: I thought you said it's a loop [19:10:57] what I proposed before was not a loop [19:11:02] v2c use app declared within the library, not declared in www/.../app.py [19:11:24] yeah, loop doesn't work [19:11:45] idk how pypy work, cuz pypy is a loop [19:12:11] how does this look zhuyifei1999_ https://github.com/JustBerry/SPIArticleAnalyzer/commit/1f7d114882c2fe8fd8af597e816bae934ff1b26c [19:12:25] or you can just use the app in app.py and call the fulctions defined in the library [19:12:48] import ~/SPIArticleAnalyzer/getAllUsers.py <= syntax error [19:13:52] zhuyifei1999_: syntax? [19:14:09] call the function from app.py? [19:15:03] ? [19:15:17] zhuyifei1999_: not clear what you mean [19:15:34] import ~/SPIArticleAnalyzer/getAllUsers.py is jut not legitimate python syntax [19:16:19] zhuyifei1999_: import /SPIArticleAnalyzer/getAllUsers.py should work then [19:16:46] look, you don't import a filename [19:16:57] you import a library... [19:17:24] import ~/SPIArticleAnalyzer/getAllUsers or /SPIArticleAnalyzer/getAllUsers ig [19:17:29] https://github.com/valhallasw/flask-mwoauth/pull/18 [19:17:37] bd808, FYI ^ [19:17:40] [13flask-mwoauth] 15halfak opened pull request #18: Switches library to use mwoauth and requests-oauthlib (06master...06master) 02https://git.io/vDcCM [19:18:16] halfak: hit and run? ;p [19:18:22] zhuyifei1999_: either of those? [19:19:13] argh [19:19:21] zhuyifei1999_: wha [19:19:22] no? [19:20:37] JustBerry: http://stackoverflow.com/a/20749411 [19:21:15] both of your suggestions are syntax errors... [19:21:16] zhuyifei1999_: yeah but that's in the sam dir [19:21:17] same dir* [19:21:23] this is in a completely different dir [19:21:26] I have to climb out of the current dir [19:21:28] then go in a few more [19:21:57] see example 4 [19:23:04] zhuyifei1999_: [19:23:06] import sys [19:23:07] import os [19:23:07] sys.path.append(os.path.abspath("/SPIArticleAnalyzer")) [19:23:08] from getAllUsers import * [19:23:12] eh [19:23:46] uh, are you sure the path "/SPIArticleAnalyzer" exists? :P [19:23:52] try ls-ing it [19:23:52] ~? [19:24:10] for ~ you will need os.path.expanduser [19:24:34] idk what's the point of os.path.abspath here though [19:24:47] zhuyifei1999_: from the example [19:25:16] it's appending the abs path [19:25:26] well, you get the ideas from an example, not simple copy from it [19:25:50] zhuyifei1999_: I understand, but in the example, it does mention /home/etc. [19:25:53] "/home/el/foo4/stuff" is an absolute path [19:25:58] ye [19:26:05] tools.spiarticleanalyzer@tools-bastion-03:~/SPIArticleAnalyzer [19:26:10] there's no even-more-absolute path [19:26:12] ~/SPIArticleAnalyzer seems to be the path [19:26:18] so I can append the path [19:26:19] yeah [19:26:21] ok [19:26:28] you need os.path.expanduser [19:26:40] import sys [19:26:41] import os [19:26:41] sys.path.expanduser(os.path.abspath("~/SPIArticleAnalyzer")) [19:26:42] from getAllUsers import * [19:26:44] zhuyifei1999_: ? o/ [19:26:48] because python might not recognize ~ [19:26:51] o [19:26:56] yeah kind of [19:26:57] no abspath on the inside? [19:27:03] change the append part or abspath part [19:27:05] to expanduser [19:27:12] o inside noe [19:27:12] I don't think abspath is necessary [19:27:15] ok [19:27:32] this seems fine then [19:27:33] import sys [19:27:34] import os [19:27:35] sys.path.expanduser("/SPIArticleAnalyzer") [19:27:37] from getAllUsers import * [19:27:39] zhuyifei1999_: ^^ [19:27:52] wait a sec [19:27:59] ok [19:28:05] https://github.com/JustBerry/SPIArticleAnalyzer/tree/master/SPIArticleAnalyzer isn't a module [19:28:23] zhuyifei1999_: and [19:28:38] wait nevermind [19:28:44] yeah [19:28:45] tht's on github [19:28:47] the outer spiarticle is ~ [19:28:47] yeah that should work [19:28:50] k [19:29:05] note that try to use as few import * as possible [19:29:21] PROBLEM - Puppet run on tools-worker-1004 is CRITICAL: CRITICAL: 40.00% of data above the critical threshold [0.0] [19:29:23] * zhuyifei1999_ thinks import * is one of the python hacks [19:30:55] zhuyifei1999_: https://phabricator.wikimedia.org/P4891 [19:31:14] os.path [19:31:19] not sys.path [19:31:33] they are confusing, I know [19:31:58] os is more system related stuffs, sys is more python related stuffs [19:33:12] zhuyifei1999_: https://phabricator.wikimedia.org/P4892 [19:33:26] wait [19:33:26] wait [19:33:28] hold on [19:33:33] it's the same let me check why [19:34:07] * zhuyifei1999_ gtg [19:35:12] https://phabricator.wikimedia.org/P4893 [19:35:14] zhuyifei1999_: o/ [19:35:16] nooo ;p [19:35:39] heh [19:40:50] tgr: o/ [19:56:55] seems there are some instability issues with Tool Labs right now? [19:57:48] that happening for anyone else? [19:58:29] many tools are hanging for a long time when I try to browse to them, and some of my tools are auto-restarting over and over [20:00:14] it seems to be intermittent. All is fine right now, but maybe every 20-30 minutes the same thing will happen [20:32:20] musikanimal: I had issues with one of my uwsgi based tools earlier today(502 errors). Manually restarting the web-service did the trick. [20:32:47] well, they come back online on their own [20:33:13] I use a monitoring service (Uptime Robot) and every 10-20 minutes things go down, but come right back [20:33:30] most recent downtime was 6 minutes ago [20:34:14] this happens occasionally, nothing unusual, but today it's frequent [20:35:29] didn't notice more drops than usual, but have not been that active today [20:46:57] musikanimal: getting a bug