I have problem with running Penpot locally (developer environment, where I can debug code)

Hi, I contributed few times in past few months and I want to continue with this initiative. Since I have my local env ready, I decided to try to learn how to do it from scratch (because I want to learn it).

What was the steps:

I forked repository, and set up forked repo with upstream:

git remote add upstream https://github.com/penpot/penpot/

I checked if everything is connected:

ondrej@Ondrej-MacBook-Pro penpot % git remote -v          
origin  https://github.com/ondrejkonec/penpot.git (fetch)
origin  https://github.com/ondrejkonec/penpot.git (push)
upstream        https://github.com/penpot/penpot.git (fetch)
upstream        https://github.com/penpot/penpot.git (push)

I make sure I have everything up to date:

 git fetch upstream
ondrej@Ondrej-MacBook-Pro penpot % git fetch upstream
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 28 (delta 18), reused 28 (delta 18), pack-reused 0
Unpacking objects: 100% (28/28), 344.38 KiB | 4.30 MiB/s, done.
From https://github.com/penpot/penpot
   82f428676..65f595076  niwinz-experiments-5 -> upstream/niwinz-experiments-5

I pull as recommended on documentation:

 ./manage.sh pull-devenv
ondrej@Ondrej-MacBook-Pro penpot % ./manage.sh pull-devenv
+ case $1 in
+ pull-devenv
+ set -ex
+ docker pull penpotapp/devenv:latest
latest: Pulling from penpotapp/devenv
Digest: sha256:9e7cec84a1d344c8b86933607298d4e678e058ff78107934cbf473cc2ce02558
Status: Image is up to date for penpotapp/devenv:latest
docker.io/penpotapp/devenv:latest

I run local dev env:

./manage.sh run-devenv
It open TMUX on window 3 - backend with this log:
penpot@b62fa2b80c69:~/penpot/backend$ ./scripts/start-dev
+ '[' '' = --watch ']'
+ clojure -A:dev -M -m app.main
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.math.numeric-tower, being replaced by: #'clojure.math.numeric-tower/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.contrib.humanize, being replaced by: #'clojure.math.numeric-tower/abs
Reflection warning, user.clj:113:28 - call to static method alength on clojure.lang.RT can't be resolved (argument types: unknown).
Reflection warning, user.clj:114:28 - call to static method alength on clojure.lang.RT can't be resolved (argument types: unknown).
Reflection warning, user.clj:115:28 - call to static method alength on clojure.lang.RT can't be resolved (argument types: unknown).
Reflection warning, user.clj:116:28 - call to static method alength on clojure.lang.RT can't be resolved (argument types: unknown).
Reflection warning, user.clj:117:28 - call to static method alength on clojure.lang.RT can't be resolved (argument types: unknown).
[2023-04-26 13:55:47.075] I app.metrics - action="initialize metrics"
[2023-04-26 13:55:47.128] I app.db - hint="initialize connection pool", name="main", uri="postgresql://postgres/penpot", read-only=false, with-credentials=true, min-size=0, max-size=60
[2023-04-26 13:55:47.312] I app.migrations - hint="running migrations", module=:app.migrations/migrations
[2023-04-26 13:55:48.581] I app.redis - hint="initialize redis resources", uri="redis://redis/0", io-threads=3, worker-threads=3, connect?=nil
[2023-04-26 13:55:51.855] I app.msgbus - hint="initialize msgbus", buffer-size=128
[2023-04-26 13:55:55.188] I app.setup.builtin-templates - hint="loading template files", total=9
[2023-04-26 13:55:56.429] I app.http - hint="starting http server", port=6060, host="0.0.0.0"
[2023-04-26 13:55:56.892] I io.undertow - starting server: Undertow - 2.3.0.Final
[2023-04-26 13:55:57.056] I org.xnio - XNIO version 3.8.8.Final
[2023-04-26 13:55:57.226] I org.xnio.nio - XNIO NIO Implementation Version 3.8.8.Final
[2023-04-26 13:55:57.755] I org.jboss.threads - JBoss Threads version 3.5.0.Final
[2023-04-26 13:55:58.278] I app.loggers.database - hint="initializing database error persistence"
[2023-04-26 13:55:58.280] I app.storage.tmp - hint="started tmp file cleaner"
[2023-04-26 13:55:58.292] I app.worker - hint="registry initialized", tasks=13
[2023-04-26 13:55:58.296] I app.worker - hint="cron: started", tasks=8
[2023-04-26 13:55:58.315] I app.worker - hint="dispatcher: started"
[2023-04-26 13:55:58.316] I app.worker - hint="monitor: started", name="default"
[2023-04-26 13:55:58.336] I app.worker - hint="worker: started", worker-id=0, queue="default"
[2023-04-26 13:55:58.338] I app.srepl - msg="initializing repl server", name="prepl", port=6063, host="localhost"
[2023-04-26 13:55:58.342] I app.worker - hint="worker: started", worker-id=0, queue="webhooks"
[2023-04-26 13:55:58.352] I app.srepl - msg="initializing repl server", name="urepl", port=6062, host="localhost"
[2023-04-26 13:55:58.360] I app.main - hint="welcome to penpot", flags="login-with-password,audit-log,backend-api-doc,fdata-storage-pointer-map,demo-users,urepl-server,webhooks,backend-worker,backend-asserts,fdata-storage-objets-map,smtp,email-verification,registration,prepl-server,transit-readable-response", worker?=true, version="develop"

My app is running (take 5-10min to load) with this error:

Do you think that there is something wrong since there is long loading? Thanks!

Hello @ondrejkonec

Could you please show the output of the tmux “shadow watch” tab?

Hello @Alex

Thanks for your reply.

It took me again like more than 5 minutes to build, but there it is:

penpot@b62fa2b80c69:~/penpot/frontend$ clojure -M:dev:shadow-cljs watch main
shadow-cljs - HTTP server available at http://localhost:8888
shadow-cljs - server version: 2.20.16 running at http://localhost:3448
shadow-cljs - nREPL server started on port 3447
shadow-cljs - watching build :main
[:main] Configuring build.
[:main] Compiling ...

There is window 2 (not sure if you are interested so pasting only screen)

If everything has finished loading and you refresh your browser you should see no errors, do you still see them?

One more thing, in the tab 0 “gulp”, everything is ok too?

The error you showed can happen if the shadow watch task hasn’t finished correctly

Yesterday, i had this error every time I run an app. Today, it’s not there (I did not change anything, so I can’t give you feedback).

I gulp window, everything is ok (since few warnings/recommendation). There is not page refresh when I make change, but I’m not sure if this function is implemented.

[07:21:32] gulp-postcss: main-default.css
autoprefixer: /home/penpot/penpot/frontend/resources/styles/main-default.css:11538:3: start value has mixed support, consider using flex-start instead
autoprefixer: /home/penpot/penpot/frontend/resources/styles/main-default.css:13288:3: start value has mixed support, consider using flex-start instead
autoprefixer: /home/penpot/penpot/frontend/resources/styles/main-default.css:13294:3: start value has mixed support, consider using flex-start instead
autoprefixer: /home/penpot/penpot/frontend/resources/styles/main-default.css:14413:3: start value has mixed support, consider using flex-start instead
autoprefixer: /home/penpot/penpot/frontend/resources/styles/main-default.css:15889:3: start value has mixed support, consider using flex-start instead
autoprefixer: /home/penpot/penpot/frontend/resources/styles/main-default.css:16617:3: end value has mixed support, consider using flex-end instead
[07:21:32] Finished 'scss:main' after 1.79 s
[07:21:32] Starting 'scss:modules'...
[07:21:32] Finished 'scss:modules' after 62 ms
[07:21:32] Starting 'scss:concat'...
[07:21:32] Finished 'scss:concat' after 45 ms
[07:21:32] Finished 'scss' after 1.9 s

Today I run the app without problem, I took me 4 minutes and 20 seconds. I still see these warning in backend window in TMUX as yesterday, but it works!

Reflection warning, user.clj:116:28 - call to static method alength on clojure.lang.RT can't be resolved (argument types: unknown).
Reflection warning, user.clj:117:28 - call to static method alength on clojure.lang.RT can't be resolved (argument types: unknown).

I will keep you up to date if there is another issue. Thank you @Alex !

Don’t worry about the warnings :slight_smile:

That error will appear if you try to access the app before shadow-watch is still booting.

About the time to fully launch the app will depend on your machine (in my case it’s much sorter than 4 minutes) and the load it has

So…I assume everything is working ok, isn’t it?

1 Like

That was not my case, it appears anytime I run the app (even when I did not try to access). But since it’s all good at the moment, I can’t give you more info. I’ll post reply here if there is some issue.

Thanks for your help @Alex, I think that I can continue with contributing :slight_smile:

Great!, thank you very much! :slight_smile:

1 Like

@Alex Hi, do you think that we can reopen this topic? No need to rush, really, I’m happy if someone can help me. But I this red error all the time when trying to run Penpot locally.

Do you think we can somehow to try to debug it?