IHP 1.3 is out now!

Gitpod instance broken

Gonzalo Muñoz

Hi! I tried cloning the template for Gitpod but when I fire it up, I get the following errors:

Warning: haddock-interfaces: /nix/store/sar2db2iiy3dmw7sag30zgwdl299i9mq-bytestring-builder-0.10.8.2.0/share/doc/x86_64-linux-ghc-8.10.4/bytestring-builder-0.10.8.2.0/html/bytestring-builder.haddock doesn't exist or isn't a file
Warning: haddock-html: /nix/store/sar2db2iiy3dmw7sag30zgwdl299i9mq-bytestring-builder-0.10.8.2.0/share/doc/x86_64-linux-ghc-8.10.4/bytestring-builder-0.10.8.2.0/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /nix/store/6kgn9fdl0z88nlmx5r51fpl3n018zs0w-typerep-map-0.3.3.0/share/doc/x86_64-linux-ghc-8.10.4/typerep-map-0.3.3.0/html/typerep-map.haddock doesn't exist or isn't a file
Warning: haddock-html: /nix/store/6kgn9fdl0z88nlmx5r51fpl3n018zs0w-typerep-map-0.3.3.0/share/doc/x86_64-linux-ghc-8.10.4/typerep-map-0.3.3.0/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /nix/store/6kgn9fdl0z88nlmx5r51fpl3n018zs0w-typerep-map-0.3.3.0/share/doc/x86_64-linux-ghc-8.10.4/typerep-map-0.3.3.0/html/typerep-map.haddock doesn't exist or isn't a file
Warning: haddock-html: /nix/store/6kgn9fdl0z88nlmx5r51fpl3n018zs0w-typerep-map-0.3.3.0/share/doc/x86_64-linux-ghc-8.10.4/typerep-map-0.3.3.0/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /nix/store/m6wn55i2p0akpd4hcwys96d2sfll99mb-ghc-api-compat-8.6/share/doc/x86_64-linux-ghc-8.10.4/ghc-api-compat-8.6/html/ghc-api-compat.haddock doesn't exist or isn't a file
Warning: haddock-html: /nix/store/m6wn55i2p0akpd4hcwys96d2sfll99mb-ghc-api-compat-8.6/share/doc/x86_64-linux-ghc-8.10.4/ghc-api-compat-8.6/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /nix/store/8k1vsmarg4zxf4asjlk65ja0cwbq17zg-mtl-compat-0.2.2/share/doc/x86_64-linux-ghc-8.10.4/mtl-compat-0.2.2/html/mtl-compat.haddock doesn't exist or isn't a file
Warning: haddock-html: /nix/store/8k1vsmarg4zxf4asjlk65ja0cwbq17zg-mtl-compat-0.2.2/share/doc/x86_64-linux-ghc-8.10.4/mtl-compat-0.2.2/html doesn't exist or isn't a directory
Updating build/Generated/Types.hs
* Main.hs (import)
* Main.hs (import)
* Main.hs (AddMountToFrontController)
+ Web/Types.hs
+ Web/Routes.hs
+ Web/FrontController.hs
+ Web/Controller/Prelude.hs
+ Web/View/Layout.hs
+ Web/View/Prelude.hs
+ Web/Controller/Static.hs
+ Web/View/Static/Welcome.hs
exit

🤙 This task ran as a workspace prebuild
🎉 Well done on saving 2 minutes

bash: ./start: No such file or directory

The project folder also seems empty. Of all the folders and files there should be, there's only

build/
Web/
.envrc
gitpod.Dockerfile
gitpod.yml
README.md

Also, if I try the template without first cloning, I get this:

ls: cannot access '/home/gitpod/.bashrc.d/*': No such file or directory
gitpod /workspace/template-ihp (main) $  HISTFILE=/workspace/.gitpod/cmd-0 history -r; {
> ( if [ ! -e "Main.hs" ]; then git init; git remote add ihp https://github.com/digitallyinduced/ihp-boilerplate.git; git pull ihp gitpod --rebase; nix-shell -j auto --cores 0 --quiet --run 'make -s all .envrc; new-application Web'; fi) && nix-shell -j auto --cores 0 --run 'make -s all .envrc' && direnv allow
> 
> } && {
> export IHP_BASEURL=`gp url 8000`; export IHP_IDE_BASEURL=`gp url 8001`; ./start
> 
> }
Reinitialized existing Git repository in /workspace/template-ihp/.git/
remote: Enumerating objects: 604, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 604 (delta 26), reused 34 (delta 10), pack-reused 540
Receiving objects: 100% (604/604), 105.06 KiB | 7.50 MiB/s, done.
Resolving deltas: 100% (307/307), done.
From https://github.com/digitallyinduced/ihp-boilerplate
 * branch            gitpod     -> FETCH_HEAD
 * [new branch]      gitpod     -> ihp/gitpod
fatal: Cannot rebase onto multiple branches.
error: getting status of '/workspace/template-ihp/default.nix': No such file or directory
gitpod /workspace/template-ihp (main) $ ihp-new blog
bash: ihp-new: command not found

What's happening? Maybe I'm doing something wrong?

marc PRO

Found the problem and made a PR https://github.com/gitpod-io/template-ihp/pull/3

You can use this fork until it's merged: https://github.com/digitallyinduced/template-ihp

Amitai Burstein

PR fixed the problem. I've noticed another thing missing while trying to adapt the Gitpod template to use with: https://gitpod.io/#https://github.com/Gizra/ihp-simple-seat-reservation

Success. You can now start the database server using:

    /nix/store/ialxlr7qv65dmxm4qd067xrfi9mgjyvq-postgresql-13.3/bin/pg_ctl -D build/db/state -l logfile start

CREATE TYPE
ERROR:  function uuid_generate_v4() does not exist
LINE 2:     id UUID DEFAULT uuid_generate_v4() PRIMARY KEY NOT NULL,
                            ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
ERROR:  function uuid_generate_v4() does not exist
LINE 2:     id UUID DEFAULT uuid_generate_v4() PRIMARY KEY NOT NULL,
                            ^

It looks like uuid-ossp extension isn't installed?

Gonzalo Muñoz

Thanks!!

marc PRO

You've found a new bug :) Fixed this via https://github.com/digitallyinduced/ihp/commit/8079dc9c528ca6ee07a995e82eff00a90624858a

Amitai Burstein

There is another issue I've noticed with Jobs not being processed on the first execution of ./start. To reproduce:

  1. Start this Gitpod - https://gitpod.io/#https://github.com/Gizra/ihp-simple-seat-reservation
  2. Goto /ShowEvent?eventId=7a7e856f-8475-48f5-977b-21bb85133a88
  3. Add a Reservation. Notice that the Seat remains un-processed. https://user-images.githubusercontent.com/125707/140622058-42de8703-a3aa-4669-b853-591b04d370b9.jpg

If you go back to Bash, stop and re-start ./start, those Jobs will be processed.

marc PRO

Found the issue. It's a race condition. In the gitpod the database is started a few moments after the app is already running. In that case the background worker tries to install it's table listeners before the database was created.

I fixed this via https://github.com/digitallyinduced/ihp/commit/7a29415d5df10d1ade43cd73ce9339d361cd60ce Now the IHP dev server restarts the app automatically in case the database finished initializing after the app was already started.

Amitai Burstein

I've applied the latest commit, but the Jobs are still not processed on the first ./start

https://gitpod.io/#https://github.com/Gizra/ihp-simple-seat-reservation

marc PRO

Ok that's strange. Let's move this topic over to github as it's kind of a different issue than reported in the original thread