04:28
fyber has joined #amber
11:11
t1|Mike has joined #amber
11:11
t1|Mike has quit [Changing host]
11:11
t1|Mike has joined #amber
14:19
<
FromGitter >
<charleystran> I am having an issue with a query which is really annoying me because it seems so simple. my query is this ```horses = HshHorse.where(raceunique: params[:id]).select``` but it throws this error ```Error: no overload matches 'Granite::Query::Assembler::Pg(HshHorse)#add_aggregate_field' with type Nil``` Does anyone have any idea what I am doing wrong?
14:21
<
FromGitter >
<Blacksmoke16> hmm
14:26
<
FromGitter >
<Blacksmoke16> @charleystran do you have a minimal example i can run that reproduces the issue?
14:42
<
FromGitter >
<drujensen> @charleystran Crystal forces you to handle the `Nil` case at compile time. In ruby, you would have been able to pass Nil and you wouldn't know until runtime that something went wrong. ⏎ It's recommended that you always handle the `Nil` case. In your situation, the `params[:id]` could be Nil. the way to fix this is to assign it to a local variable and handle the else case when `Nil`: ⏎ ⏎ ``````
14:42
<
FromGitter >
<Blacksmoke16> i dont think thats the issue @drujensen, you should be able to pass `nil` there since it would just make the query like `WHERE raceunique IS NULL`
14:43
<
FromGitter >
<Blacksmoke16> which would result in the wrong data being returned, but shouldnt result in a compile error
14:44
<
FromGitter >
<charleystran> I actually think I may have found the issue. Its a legacy database with no id column or primary key. So the default order logic is where its failing
14:44
<
FromGitter >
<Blacksmoke16> 👍
14:45
<
FromGitter >
<drujensen> 👍
14:46
<
FromGitter >
<charleystran> yes, that was it. Thank you both for the responses!
14:48
<
FromGitter >
<Blacksmoke16> np
18:54
<
FromGitter >
<Blacksmoke16> oh noes
18:54
<
FromGitter >
<Blacksmoke16> welcome back?
19:24
FromGitter has quit [Remote host closed the connection]
19:24
FromGitter has joined #amber
19:45
FromGitter has quit [Remote host closed the connection]
19:45
FromGitter has joined #amber
20:02
FromGitter has quit [Remote host closed the connection]
20:02
FromGitter has joined #amber
20:05
FromGitter has quit [Remote host closed the connection]
20:05
FromGitter has joined #amber
20:07
FromGitter has quit [Remote host closed the connection]
20:07
FromGitter has joined #amber
20:09
FromGitter has quit [Remote host closed the connection]
20:10
FromGitter has joined #amber
20:15
FromGitter has quit [Remote host closed the connection]
20:15
FromGitter has joined #amber
20:22
FromGitter has quit [Remote host closed the connection]
20:22
FromGitter has joined #amber
20:41
FromGitter has quit [Remote host closed the connection]
20:41
FromGitter has joined #amber
20:45
FromGitter has quit [Remote host closed the connection]
20:46
FromGitter has joined #amber
20:47
FromGitter has quit [Remote host closed the connection]
20:48
FromGitter has joined #amber
20:57
FromGitter has quit [Remote host closed the connection]
20:58
FromGitter has joined #amber
21:03
FromGitter has quit [Remote host closed the connection]
21:03
FromGitter has joined #amber
21:12
FromGitter has quit [Remote host closed the connection]
21:12
FromGitter has joined #amber
21:31
FromGitter has quit [Remote host closed the connection]
21:32
FromGitter has joined #amber
22:57
<
FromGitter >
<nsuchy> weird error I get
22:57
<
FromGitter >
<nsuchy> after running shards install
22:58
<
FromGitter >
<nsuchy> @Blacksmoke16 maybe this is a granite bug
22:58
<
FromGitter >
<Blacksmoke16> try running `shards update`
22:59
<
FromGitter >
<nsuchy> same error
23:00
<
FromGitter >
<Blacksmoke16> uhh
23:01
<
FromGitter >
<Blacksmoke16> what does `ulyer/CrystalProxmox` depend on
23:02
<
FromGitter >
<nsuchy> idk it hasn't been updated in ages
23:02
<
FromGitter >
<Blacksmoke16> basic one of your deps depends on 0.6.0 of `crystal-db`
23:02
<
FromGitter >
<Blacksmoke16> while granite/db drivers here depend on `0.7.0`
23:02
<
FromGitter >
<nsuchy> it has
23:02
<
FromGitter >
<nsuchy> no dependeices
23:03
<
FromGitter >
<nsuchy> pure
23:03
<
FromGitter >
<nsuchy> crystal
23:03
<
FromGitter >
<nsuchy> :D
23:03
<
FromGitter >
<Blacksmoke16> whats your shard.lock
23:03
<
FromGitter >
<Blacksmoke16> its prob some dep of another dep
23:05
<
FromGitter >
<Blacksmoke16> thats your problem
23:08
<
FromGitter >
<nsuchy> what do I change in my shard.yml file
23:11
<
FromGitter >
<Blacksmoke16> you'll have to wait for that to be merged
23:13
<
FromGitter >
<nsuchy> so like
23:13
<
FromGitter >
<nsuchy> all sites were affected overnight or what happened exactly?
23:13
<
FromGitter >
<nsuchy> can I revert to an older amber version
23:13
<
FromGitter >
<Blacksmoke16> new crystal version got released
23:13
<
FromGitter >
<Blacksmoke16> which apparently broke your shards due to prob using master on everything
23:14
<
FromGitter >
<Blacksmoke16> got into a situation where some are using new compatible code, and others require not yet updated code
23:18
<
FromGitter >
<nsuchy> can confirm production got updated automatically
23:18
<
FromGitter >
<nsuchy> to new crystal release
23:19
<
FromGitter >
<nsuchy> root@panel:~/ulayerpanel# snap revert crystal ⏎ crystal reverted to 0.30.1
23:19
<
FromGitter >
<nsuchy> lets see
23:21
<
FromGitter >
<Blacksmoke16> rip
23:22
<
FromGitter >
<Blacksmoke16> prob not the best idea to use snap in prod as your dep manager...
23:22
<
FromGitter >
<Blacksmoke16> for this very reason
23:22
<
FromGitter >
<nsuchy> lol
23:22
<
FromGitter >
<nsuchy> yeah
23:22
<
FromGitter >
<nsuchy> so at this point
23:23
<
FromGitter >
<nsuchy> readding in those version strings
23:23
<
FromGitter >
<nsuchy> but even then
23:23
<
FromGitter >
<nsuchy> it's pulling newer than needed code
23:23
<
FromGitter >
<nsuchy> I deleted shard.yml and lib folder
23:23
<
FromGitter >
<nsuchy> but now it's not recreating them
23:23
<
FromGitter >
<nsuchy> i mean shard.lock
23:24
<
FromGitter >
<Blacksmoke16> well you have `master` as the branch for like all your shards
23:24
<
FromGitter >
<nsuchy> site back up now so production is fixed with a simple revert
23:24
<
FromGitter >
<nsuchy> trying to fix my dev env now
23:24
<
FromGitter >
<Blacksmoke16> step 1, dont use `master` branch
23:25
<
FromGitter >
<nsuchy> this is my new shards.yml file
23:25
<
FromGitter >
<Blacksmoke16> use specific commit hashes if you need stuff from master that isnt released yet
23:25
<
FromGitter >
<nsuchy> it's not creating a new shard.lock file
23:25
<
FromGitter >
<Blacksmoke16> is there an error?
23:26
<
FromGitter >
<nsuchy> i just restored previous from trash
23:26
<
FromGitter >
<nsuchy> but I want to reinstall all deps from scratch
23:31
<
FromGitter >
<nsuchy> my restored shard.lock file doesn't change when running shards update
23:31
<
FromGitter >
<nsuchy> so it's further ahead that what I'm pulling
23:31
<
FromGitter >
<Blacksmoke16> prob accurate
23:32
<
FromGitter >
<Blacksmoke16> you'd want to set the version of your shards to the last release
23:32
<
FromGitter >
<Blacksmoke16> for those that are using crystal-db
23:32
<
FromGitter >
<Blacksmoke16> as if you use the current release it would require you have the new version of it
23:34
<
FromGitter >
<nsuchy> this works for now
23:34
<
FromGitter >
<nsuchy> ;)
23:36
<
FromGitter >
<Blacksmoke16> 👍
23:55
<
FromGitter >
<nsuchy> has amber started investigaitng this yet?
23:55
<
FromGitter >
<nsuchy> and whether it could speed up apps
23:57
<
FromGitter >
<Blacksmoke16> idk, prob a bit