Submit

Back to the channels

#primate

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

Search posts