Submit

Back to the channels

#primate

  1. phaleth hi
  2. phaleth still getting the same error when trying to start nevet https://paste.debian.net/plainh/dab58abd
  3. phaleth postgres is reachable from the app server https://paste.debian.net/plainh/0108da55 and I'm not sure if I should try postgres 17.9
  4. phaleth it's very difficult to debug startup of this application since it leaves no clue if it can or cannot read environment variables on startup
  5. phaleth afk
  6. phaleth looks like I should update gitea once gitea 1.25.5 is out and figure out how to build prometheus from source https://go.dev/blog/allocation-optimizations
  7. nevet Allocating on the Stack - The Go Programming Language
  8. phaleth also shame on google for not doing these optimizations much much earlier
  9. blue phaleth: yes, that's the error I got
  10. blue dreamreal: any idea how we can debug this?
  11. blue Feb 28 06:45:48 nevet java[55]: SQL State : 08001
  12. blue phaleth: are you sure the nevet container can see the app one, they're on the same network?
  13. blue Caused by: java.net.UnknownHostException: postgres:bfK7kP2fcyO7oUxN@192.168.1.105
  14. phaleth oh it leaks password
  15. bot <discord:blue> yes
  16. phaleth yeah, the nevet app can reach the db container, see the second paste
  17. blue oh, this is from the nevet app?
  18. phaleth I think env vars are not being read
  19. phaleth yeah, it's java
  20. blue are the env vars available in the container
  21. blue ?
  22. phaleth or is nevet not java? I don't know what this is then, was supposed to deploy the java app
  23. blue yes, nevet is kotlin, which is java
  24. phaleth env vars are set by systemd
  25. blue can you do echo $DB_URL in the container?
  26. blue actually, I think I can enter the container myself and check
  27. blue ce332a-nevet-srv
  28. blue ?
  29. phaleth no you cannot, cause env vars are set only for the systemd process that manages the kotlin or whatever app
  30. blue nevet.service?
  31. phaleth which apps can normally read just fine, but not this one
  32. phaleth yeah
  33. blue man I can't even use ping from inside the container
  34. blue those images are really reduced :P
  35. phaleth apt update
  36. phaleth apt install iputils-ping
  37. blue thx
  38. phaleth np
  39. blue hm, looks fine indeed
  40. blue yup:
  41. blue root@nevet:/etc/systemd/system# systemctl show nevet --property=Environment
  42. blue Environment=
  43. phaleth anyway, normally applications should be self-discoverable, they should tell what you need to configure and error out if something is missing, but this is again some stuff hacked together that only runs on the developers machine
  44. phaleth the systemd property is called EnvironmentFile
  45. blue yes
  46. blue Feb 28 12:21:19 nevet java[892]: Build: ${git.commit.id.abbrev} (${git.branch}) ${git.build.time}
  47. blue btw this line is also suspicious
  48. phaleth I used a zip copy of the code to build the app
  49. blue phaleth: looks better, I removed username/password from the connection string, it kills java
  50. blue instead, it loads them from the env vars
  51. blue now there's some oauth2 issue
  52. blue Feb 28 12:24:37 nevet java[945]: Caused by: java.lang.IllegalStateException: Client id of registration 'google' must not be empty.
  53. blue HMMMMMM
  54. blue dreamreal: is this a hard requirement?
  55. phaleth ok, cool, I had no idea that was the problem and why I have to specify the credentials second time
  56. blue at least we're getting somewhere. but I think now we need dreamreal's help, and it's shabbat, he might be slow to respond
  57. blue it's actually better this way, phaleth. the password doesn't get leaked
  58. phaleth yeah, I'll reset the password
  59. blue I'd still prefer if the jdbc connection string supported that, but it's ok
  60. blue apparently this is the officially documented for postgres jdbc: jdbc:postgresql://[REDACTED:url-credentials]@host:port/database
  61. blue ah, sorry, I mean this:
  62. phaleth I'd prefer jdbc making any sense in it's error messages
  63. blue jdbc:postgresql://host:port/database
  64. blue true
  65. phaleth ok
  66. blue apparently what also works are params
  67. blue jdbc:postgresql://host:port/database
  68. blue with ?user=...&password=...
  69. phaleth ok, it run migrations
  70. blue it did?
  71. blue I can't tell, it's borked because there's no google client id
  72. blue btw phaleth: https://github.com/primate-run/primate/issues/251
  73. nevet Proposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate
  74. phaleth here's the almost full log https://api.pastecode.io/anon/raw-snippet/rwoe5ynj?raw=inline&ticket=329e0fa6-7403-4e9a-adb3-d78889e19cb5
  75. nevet Untitled (rwoe5ynj) - PasteCode.io
  76. blue phaleth: meanwhile, could you change the deployment to come from https://gitea.repopack.app/blue/bytecode.news
  77. blue because this contains the primate app in apps/primate
  78. blue for which we also need a container
  79. phaleth yeah, I can try
  80. blue nice log, yes I get the same google error
  81. blue apparently it needsa GOOGLE_CLIENT_ID and _SECRET
  82. blue https://gitea.repopack.app/blue/bytecode.news/src/branch/master/.env.default
  83. blue this isn't documented here yet
  84. blue phaleth: https://gitea.repopack.app/blue/bytecode.news/src/branch/master/docs/deployment.md
  85. blue `Nevet supports "Sign in with Google" and "Sign in with GitHub" via OIDC / OAuth2. Both are optional and independent -`
  86. blue hm
  87. blue maybe this is a bug
  88. blue it should work without the GOOGLE_CLIENT_ID, but maybe the env variable has to be set? dunno
  89. blue yeah, I don't think it's optional
  90. blue spring picks it up automatically, and tries to configure it, hits empty string or missing property, dies
  91. phaleth "If `GOOGLE_CLIENT_ID` and `GITHUB_CLIENT_ID` are both empty, OIDC endpoints are not registered and the app runs OTP-only."
  92. blue yeah, that's simply not true in this case. or maybe we need to include those two env vars but set them to empty
  93. blue should I try that?
  94. phaleth not sure if whatever reads those properties is that dumb, but null and empty is something different for sure
  95. phaleth I mean env vars
  96. blue yeah, it's spring, and spring is a truckload of magic that no one understands
  97. blue I'm gonna try empty vars. but empty vars should be virtually the same as non-existent
  98. blue nope, still dying
  99. blue OMG
  100. blue chatgpt is telling me I need to "Move the Google registration into a profile:"
  101. blue but then I'll need to rebuild the container
  102. phaleth I can rebuild the container
  103. phaleth but I don't follow what chatccp is saying
  104. dreamreal You should be able to put trash values in there, and I'm going to try to figure out how to make those things optional - it shouldn't be that hard to do - but the UI shoudl expect OIDC to be present, is the problem
  105. dreamreal but you shouldn't have to rebuild a container to provide values to it, we need to be able to externalize them and put them in .env and docker just imports them
  106. phaleth agreed
  107. phaleth blue: I assume you can just rebase https://gitea.repopack.app/blue/bytecode.news ?
  108. blue phaleth: yes, once dreamreal fixes this google nonsense
  109. blue I don't know if I can just delete it from application.yml and it would work
  110. phaleth ok
  111. phaleth let's try getting the code from gitea then
  112. blue yes, it has the primate app under apps/primate, too
  113. blue I'm gonna sync my gh fork, then pull down stuff onto gitea
  114. blue omg
  115. phaleth there's a CLI called tea
  116. blue Merge branch 'jottinger:main' into master
  117. blue did I tell you how much I hate GH?
  118. blue instead of rebasing my branch, it does this nonsense
  119. blue my fork*
  120. phaleth all of these cli's are garbage
  121. phaleth glab on top
  122. blue it's not a cli
  123. blue I went to gh, hit 'sync' fork
  124. phaleth gh is github cli
  125. blue oh man
  126. blue github is such a garbage website
  127. blue oh man and I asked chatgpt and it spews total nonsense
  128. blue it claims rebase rewrites history. no it wouldn't, it wouldn't rewrite the upstream history, that's the poitn
  129. blue nvm, I'll do it myself
  130. blue github ui is nonsense
  131. phaleth yeah, and I'll just download tar over https during the build, cannot be bothered figuring out something else
  132. blue phaleth: done
  133. blue gitea is rebased against the latest commmit + two primate app commits
  134. blue https://gitea.repopack.app/blue/bytecode.news
  135. blue once he pushes out a fix, I can easily rebase again and push out to gitea
  136. blue we need `ce332a-nevet-app` for primate, right?
  137. phaleth for primate?
  138. phaleth no clue
  139. phaleth I'll deploy the kotlin thing to that container
  140. blue you want to put them in the same container?
  141. phaleth oh, you always call everything app
  142. blue the nevet java thingy is -srv
  143. phaleth and that container name does not exist obviously, but I get it
  144. phaleth yeah
  145. blue I was thinking you'd add -app for the primate app
  146. blue so specifically, for the code under apps/primate
  147. phaleth yeah
  148. phaleth I mean nah
  149. dreamreal okay, found it: creating an issue and I'm going to create a runtime profile so you can enable/disable OIDC with an invocation flag
  150. phaleth look at: sudo machinectl list
  151. phaleth if everthing was an app that'd be a disaster
  152. blue ce332a-nevet-db container systemd-nspawn debian 13 192.168.1.105…
  153. blue ce332a-nevet-srv container systemd-nspawn debian 13 192.168.1.107…
  154. phaleth it already is in other ways
  155. blue I was thinking you'd add ce332a-nevet-app for the primate app
  156. phaleth I will add another container for primate, sure, but not gonna label it with -app
  157. blue sure, call it whatever you like
  158. dreamreal I'm gonna have a PR for this in a few minutes
  159. dreamreal SPRING_ACTIVE_PROFILES=oidc java -jar app-1.0.jar # this will require OIDC, ignore it otherwise
  160. phaleth ok
  161. dreamreal main has been updated
  162. blue phaleth: it's on gitea
  163. dreamreal so: the *configuration* hasn't changed in .env but it won't try to use OIDC unless that profile is activated
  164. dreamreal I've got another issue for the UI to be able to introspect whether OIDC is enabled or not, but I haven't written anything for it yet
  165. blue ah sorry dreamreal, I accidently pushed to upstream/master, let me delete it
  166. dreamreal https://github.com/jottinger/bytecode.news/issues/128
  167. phaleth I will just put SPRING_ACTIVE_PROFILES=oidc into the env file
  168. dreamreal phaleth: do that ONLY IF YOU WANT OIDC enabled
  169. dreamreal if you don't, yeet it
  170. dreamreal the default profile will not use OIDC
  171. phaleth ok, I'll get rid of it then
  172. dreamreal OIDC means configuring the google oauth tokens and setting up the github stuff
  173. blue ok, I deleted it again
  174. dreamreal for developers, that shouldn't be necessary unless they're specifically testing that path
  175. blue dreamreal: it's best if you changed my role on the original repo to readonly
  176. blue I'll keep accidently pushing master otherwise, but I don't need to
  177. phaleth or just migrate github -> gitea, main -> master
  178. dreamreal you're gonna love this, blue: github doesn't let me set it to readonly :D
  179. blue yeah that's what I did, but I accidently did `git push origin` and it pushed it to his repo
  180. dreamreal Not for a private repo, maybe
  181. blue or well, git push upstream, that was dumb
  182. phaleth hmm, could set the main branch as protected or whatever github calls that
  183. blue I have upstream = his repo (jottinger/bytecode.news), origin (gitea) and then github (same fork, on github)
  184. dreamreal phaleth: doing that now
  185. blue I don't think I need github at all, but once I start sending him PRs, I don't know if I can do it from gitea
  186. dreamreal oh, damn you github
  187. dreamreal won't apply to the repo because it's private
  188. dreamreal it might be good enough that it's time to move it, actually
  189. phaleth heh
  190. dreamreal blue: what do you think? Nevet's exceeded the prior version enough to become IT?
  191. phaleth I have no problem giving your access to our gitea
  192. dreamreal dear god no
  193. dreamreal I'm swimming in access as it is
  194. blue phaleth, he means moving it to a public github repo, I think. but why move it, dreamreal, why not just open up the repo?
  195. blue if you move it you lose all the issues
  196. dreamreal I was just gonna rename it and open it
  197. blue or do you mean with 'move', change from private to public?
  198. blue oh, gotcha
  199. dreamreal but maybe opening it is enough
  200. phaleth ah, ok
  201. blue well this limitation is ridiculous anyway
  202. dreamreal everything is ridiculous, that's why we laugh
  203. blue no I mean, the way github cripples its features when your repo is private
  204. blue under the guise of promoting FOSS. but it's exactly the opposite, they want you to pay
  205. blue private & public should get the same treatment, and premium features should cost either way
  206. blue anyway
  207. blue don't open it up on my behalf
  208. blue I'll try to set up git to prevent me from accidently pushing master to upstream
  209. dreamreal so: any opinion on it being streampack vs bytecode.news?
  210. dreamreal doeth the speaky-speaky things now, losers, or forever hold thy peace
  211. blue I don't have a specific opinion. but currently you're using three names and it's confusing, pick one and stick to it. if you already got the domain, then bytecode it is
  212. dreamreal we're jews, names are transitory, be a jew :D
  213. blue ya well
  214. dreamreal phaleth: any opinion? We have one vote for bytecode.news
  215. phaleth say it three times and you'll see
  216. dreamreal for some reason it counts
  217. blue lol
  218. phaleth react-router react-router react-router, doesn't catch on
  219. dreamreal I have more votes than anyone else, so I win no matter what, but I'd like to hear from the el gallery anyway
  220. dreamreal bytecode.news three times isn't catchy either but that's fine
  221. blue I told him bytenews is better, but he won't listen
  222. dreamreal I actually like nevet but nevet's a specific instance, not THE PROJECT
  223. blue I'd personally get the domain bytenews.dev :P
  224. dreamreal phaleth: any opinion?
  225. dreamreal blue: I may have already gotten it
  226. dreamreal I don't remember
  227. phaleth nevet should have ended with h, then it'd be cool like phaleth
  228. phaleth wasted opportunity there
  229. dreamreal phaleth: only dorks' names end in h
  230. phaleth heh
  231. * dreamreal used to use "Epesh" as a nick for YEARS
  232. dreamreal and in some communities Epesh is still remembered
  233. dreamreal blue: my hebrew is very very strong, as you see: mistranslit of efes
  234. blue yes I noticed. you also seemed to remember nevet means stream
  235. dreamreal I know, I know
  236. dreamreal I forget the first name we came up with
  237. dreamreal but I like nevet
  238. blue thankfully, I'm here to correct you
  239. dreamreal I also like alit but I know a really cute lady named alit and that would be unseemly
  240. dreamreal I figured you deserved a chance to be right for once
  241. blue yeah that's a girl's name, nevet's a boy
  242. dreamreal mmm alit. If I'd been single I'd have seen her as a missed opportunity. Wonderful lady, though. Flighty, red hair, lithe... and a missile launch technician in the IDF :D
  243. blue yeah you don't wanna mess with that
  244. dreamreal now a yoga instructor in sfarad
  245. blue hahahaha
  246. dreamreal oh if I'd been single I'd DEFINITELY have wanted to mess with that
  247. dreamreal I was not, plus I'm a professional, so there's no effin' way but biologically hell to the yes
  248. blue well yeah, that's the problem isn't it
  249. dreamreal not a problem. I love alit as a friend. There's no temptation there; she's just a hell of a person and I respect that.
  250. dreamreal phaleth: fine, you have no opinion
  251. dreamreal dealer's choice wins: I have voted as well
  252. blue heh
  253. phaleth yeah, I'd say thanks for asking for an opinion, but I can't give any on something I have no clue about
  254. blue lol
  255. phaleth btw, before you open up the github repo to the world consider the following
  256. phaleth setup the copy of the repo somewhere else, and use the github repo as a mirror and continue using github only for issues and abandon PRs
  257. phaleth and of couse setup an action/pipeline/whatever to push to github automatically
  258. phaleth PRs on github can be disabled, not sure that's a paid feature
  259. blue it's been recently added, not paid
  260. dreamreal I don't want them disabled, I want them demanded
  261. dreamreal phaleth: that's certainly an option but no
  262. phaleth yeah, right, the point of a mirror is to be read-only except for the action/pipeline from the other repo
  263. blue phaleth, did the oauth problem get solved?
  264. phaleth not yet, trying to find a place where to generate token in gitea
  265. dreamreal which oauth problem are you trying to solve?
  266. dreamreal and bytecode.news is now a public repo
  267. phaleth oh, ok, what's the github url?
  268. dreamreal github.com/jottinger/bytecode.news
  269. phaleth I think blue will want his stuff to be there, so I'll search for how to get the token from gitea
  270. phaleth private access token I mean
  271. blue ya
  272. phaleth ah, so it's under Settings -> Applications
  273. blue cool
  274. phaleth looks good now https://quickpaste.net/iWAoGlr/plain
  275. blue good
  276. blue now we need the primate app, no?
  277. blue can you expose it under nevet.repopack.app?
  278. phaleth sits at the top https://images4.imagebam.com/1a/5a/bf/ME1AZS3Y_o.png
  279. phaleth try if it's reachable at nevet.repopack.app
  280. phaleth I actually have absolutely zero clue how to test that app
  281. phaleth curl maybe
  282. blue let me add an index app
  283. phaleth I guess it's not listening on port 80
  284. blue nope, it'd be the normal primate port at 6161
  285. blue done
  286. phaleth ok, it's listening on 8080 but should I open that to the interwebz you mean?
  287. blue https://gitea.repopack.app/blue/bytecode.news/commit/9cbc244b72d5b46b0bf7a7c0fd465484d7ea9eb2
  288. blue the java app is listening on 8080
  289. blue but you only need to open the primate app
  290. phaleth the one which I didn't deploy yet
  291. blue yes
  292. blue the primate app will send requests to the nevet api, internally, on the network
  293. blue but only it will be exposed outside
  294. phaleth ok, makes sense
  295. blue so my ideal setup is, I have a script or something to pull & redeploy the nevet primate app / nevet itself, think we can do that?
  296. phaleth no package-lock.json again, ok
  297. blue yes
  298. blue I don't do package-lock.jsons :P
  299. phaleth I'll push the documentation once you tell me it works
  300. phaleth and then you can automate, but hold on
  301. blue k
  302. phaleth blue: https://quickpaste.net/fGq-nFg
  303. nevet Quickpaste
  304. phaleth Node.js v25.7.0
  305. blue sweet
  306. dreamreal Gah
  307. dreamreal url list
  308. dreamreal url ignore list
  309. nevet Ignored hosts include: x.com, twitter.com, paste.debian.net, pastebin.com, bpa.st, dpaste.com, and pastebin.org
  310. dreamreal url ignore add quickpaste.net
  311. nevet Added quickpaste.net to ignored hosts.
  312. blue Feb 28 15:08:48 nevet-primate node[75]: Error: Cannot find module '/app/build/server.js'
  313. blue what's that?
  314. blue nevet-prmt, is that the machine, phaleth?
  315. phaleth well I have no clue how to start it
  316. phaleth yeah
  317. phaleth it builds, prolly outputs a build dir
  318. phaleth server.js is what I'd expect
  319. blue yes
  320. blue hm
  321. phaleth ah, the build subdir got omitted
  322. blue yes
  323. blue though even if I run `node server.ts`, it fails
  324. blue hm hm hm
  325. phaleth server.ts?
  326. phaleth think that will work on node, I guess it should
  327. blue server.js
  328. blue sorry
  329. phaleth ok, well, let me rebuild
  330. blue so locally it works for me `node build/server.js`
  331. blue so when I'm automatically, I'm gonna overlay a .env file onto the build,
  332. blue when I'm automating it*
  333. blue this is actually something I haven't explored yet, because .env files aren't usually baked into a build
  334. blue I'll just copy it into `build` after `npm run build` runs, in the Containerfile, I think
  335. phaleth ok, blue, it fails on some sort of assert https://quickpaste.net/7PWeP6l
  336. blue yeah that's what I can see locally
  337. blue or well, if I try to run it within the image
  338. blue maybe a package.json is necessary
  339. blue let me stub it
  340. phaleth ok, I gotta go out, I'll just push the documentation to gitea for you to see what I've done
  341. blue alrighty
  342. blue welp, got it running on 6161
  343. blue now I just need to adapt the haproxy config and reload the haproxy containre, no?
  344. blue ah, you already have it
  345. blue sweet
  346. phaleth check the provision repo the last commit - 0ac59c2a890370a11d1a246b6bff4072518228c4
  347. blue before you go, do you have any idea why nevet.repopack.app isn't working?
  348. blue the app is running in the container at port 6161
  349. blue also, thanks for the docs, I'll automate it into a script so I can easily redeploy
  350. phaleth it's still repeatedly crashing with that error
  351. phaleth need to rebuild and restart as per instructions
  352. blue Feb 28 15:25:57 nevet-primate systemd[1]: Started nevet-primate.service - Primate Nevet Site.
  353. blue Feb 28 15:25:57 nevet-primate node[4114]: » app url http://localhost:6161
  354. blue that's inside the ocntainer though
  355. blue hm, maybe localhost is false
  356. phaleth try this
  357. phaleth journalctl -n 150 -f -u nevet-primate
  358. blue ya
  359. blue it contains old entries
  360. blue oh
  361. blue you mean it keeps crashing?
  362. phaleth yeah
  363. phaleth if you are not sure then wipe out the container and try again
  364. blue the last two lines though are
  365. blue Feb 28 15:25:57 nevet-primate systemd[1]: Started nevet-primate.service - Primate Nevet Site.
  366. blue Feb 28 15:25:57 nevet-primate node[4114]: » app url http://localhost:6161
  367. phaleth weird
  368. phaleth let me ditch it
  369. blue if you recreate the container, you'll have the same problem
  370. blue you need to copy over the original package.json, outside of build
  371. blue this is a primate bug
  372. blue or an rcompat bug, doesn't matter, but you need a package.json somewhere because it uses that to find paths
  373. phaleth I'm rebuilding with --no-cache
  374. phaleth oh, ok
  375. blue oki, but make sure you copy `package.json` from the repo onto /app
  376. phaleth into /app and not /app/build?
  377. blue yes
  378. phaleth weird
  379. blue it's something I need to fix, I don't know why it does on a production build where everything is self-contained
  380. blue why it does that*
  381. blue you did everything right, it's a primate problem, but I can't fix it in primate quickly
  382. blue so for now copying the original package.json will solve it
  383. blue dreamreal: is there a reason java container is costing us 700mb of RAM?
  384. phaleth it's running
  385. blue but nevet.repopack.app is still not working?
  386. phaleth it does
  387. blue weird, I get 503
  388. blue https://nevet.repopack.app is working for you?
  389. phaleth » app url http://localhost:6161
  390. phaleth gotta configure it to listen to any address
  391. blue ok, that would be 0.0.0.0
  392. phaleth from the VM I get:
  393. phaleth $ curl -IL 192.168.1.108:6161
  394. phaleth curl: (7) Failed to connect to 192.168.1.108 port 6161 after 0 ms: Could not connect to server
  395. phaleth anyway, you can do it blue, it's the same old same old, primate issues from now on :D
  396. blue alright
  397. blue let me figure out how I can rebuild the machine
  398. blue heh, you're using an auth header
  399. blue sweet
  400. blue Merge pull request #136 from jottinger/feature/128-feature-discovery-endpoint

Search posts