unmade/shelf-showcase

Error on browser

Colors45 opened this issue · 11 comments

I just installed shelf on my server.
When I open shelf on my server I get this error in the browser console:

TypeError: Cannot read properties of undefined (reading 'forEach')
    at features.js:12:11
    at toolkit.js:1113:32
    at produce (toolkit.js:1:8392)
    at toolkit.js:1112:28
    at Array.reduce (<anonymous>)
    at v (toolkit.js:1091:29)
    at toolkit.js:453:29
    at toolkit.js:453:29
    at bd (index.js:35:10)
    at f (toolkit.js:282:22)

and

The above error occurred in task $Y
    created by $Y
    created by takeEvery(features/list, $Y)
    created by Dd
Tasks cancelled due to error:
takeEvery(features/list, $Y)
Dd
takeEvery(accounts/getSpaceUsage, OY)
takeEvery(accounts/listAccounts, PY)
takeEvery(accounts/retrieveCurrentAccount, NY)
takeLatest(auth/signIn, YY)
takeLatest(auth/refreshToken, ZY)
takeEvery(auth/signUp, FY)
takeEvery(files/createFolder, UY)
takeEvery(files/deleteImmediately, WY)
takeEvery(files/deleteImmediatelyBatch, GY)
takeEvery(files/download, qY)
takeEvery(files/emptyTrash, KY)
takeEvery(files/findDuplicates, JY)
takeEvery(files/getBatch, QY)
takeEvery(files/getContentMetadata, XY)
takeEvery(files/listFolder, tF)
takeEvery(files/moveFile, eF)
takeEvery(files/moveFileBatch, rF)
takeEvery(files/moveToTrash, aF)
takeEvery(files/moveToTrashBatch, nF)
takeEvery(files/performDownload, lF)
takeLeading(tasks/taskStarted, vF)
takeEvery(tasks/taskStarted, mF)
takeEvery(users/addBookmark, SF)
takeEvery(users/listBookmarks, Pz)
takeEvery(users/removeBookmark, yF)
takeEvery(auth/signIn/fulfilled, Pz)

Hey @Colors45

I've just released a big refactoring on the frontend. Can you please pull fresh copy of this repository, pull latest images (fdooch/shelf-front:0.1.0-alpha.10 and fdooch/shelf-back:0.1.0-alpha.9) and check if the there is still problem?

Hey @Colors45

I've just released a big refactoring on the frontend. Can you please pull fresh copy of this repository, pull latest images (fdooch/shelf-front:0.1.0-alpha.10 and fdooch/shelf-back:0.1.0-alpha.9) and check if the there is still problem?

This now gives me that error:

Error response from daemon: driver failed programming external connectivity on endpoint shelf-showcase-shelf-front-1 (0eebc73442bf808d7c8f5c0e1085f6188141a7e0b322dd6ca4e092d771b768e3): Bind for 0.0.0.0:8090 failed: port is already allocated

I double checked that port 8090 isn't used before I executed docker compose up

I've only got that problem when some port is actually in use. All I can suggest is to try commands from this stack overflow answer:

lsof -i:8090
kill $(lsof -t -i:8090)

This didn't help, this was the first I tried.
I reseted all docker network configs and this seemed to fix it.

Now it's starting but I can't login and when I look at the console I see this error:
GET http://<MyIP>:8005/features/list net::ERR_CONNECTION_REFUSED

Is your frontend running over https or http?

http

I'm not sure where lies the problem here. I was able to reproduce it for a moment, but after opening http://<MyIP>:8005/features/list in a new tab the problem was gone.

Can you check if you can open http://<MyIP>:8005/features/list in a new tab?

When I try to open http://<MyIP>:8005/features/list in a new tab I get the same error code: ERR_CONNECTION_REFUSED

You should be able to open that link directly via browser and see the response. You can get this error if shelf_back container is not up and running. Can you please check docker logs and see if there is errors for shelf_back?

shelf-showcase-shelf-back-1    | Traceback (most recent call last):
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/src/shelf-back/app/crud/user.py", line 89, in create
shelf-showcase-shelf-back-1    |     await conn.query_required_single(
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/local/lib/python3.11/site-packages/edgedb/abstract.py", line 2                                                                                                   52, in query_required_single
shelf-showcase-shelf-back-1    |     return await self._query(QueryContext(
shelf-showcase-shelf-back-1    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/local/lib/python3.11/site-packages/edgedb/transaction.py", lin                                                                                                   e 190, in _query
shelf-showcase-shelf-back-1    |     return await self._connection.raw_query(query_context)
shelf-showcase-shelf-back-1    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/local/lib/python3.11/site-packages/edgedb/base_client.py", lin                                                                                                   e 234, in raw_query
shelf-showcase-shelf-back-1    |     return await self._protocol.query(**args)
shelf-showcase-shelf-back-1    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "edgedb/protocol/protocol.pyx", line 592, in query
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "edgedb/protocol/protocol.pyx", line 557, in execute
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "edgedb/protocol/protocol.pyx", line 462, in _execute
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    | edgedb.errors.ConstraintViolationError: username violates exclusivity const                                                                                                   raint
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    | The above exception was the direct cause of the following exception:
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    | Traceback (most recent call last):
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/src/shelf-back/manage.py", line 95, in <module>
shelf-showcase-shelf-back-1    |     cli()
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/src/shelf-back/manage.py", line 53, in createsuperuser
shelf-showcase-shelf-back-1    |     asyncio.run(_createuser(username, password))
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
shelf-showcase-shelf-back-1    |     return runner.run(main)
shelf-showcase-shelf-back-1    |            ^^^^^^^^^^^^^^^^
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
shelf-showcase-shelf-back-1    |     return self._loop.run_until_complete(task)
shelf-showcase-shelf-back-1    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/local/lib/python3.11/contextlib.py", line 222, in __aexit__
shelf-showcase-shelf-back-1    |     await self.gen.athrow(typ, value, traceback)
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/src/shelf-back/app/db.py", line 74, in create_client
shelf-showcase-shelf-back-1    |     yield client
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/src/shelf-back/manage.py", line 45, in _createuser
shelf-showcase-shelf-back-1    |     await actions.create_account(conn, username, password, superuser=True)
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/src/shelf-back/app/actions.py", line 82, in create_account
shelf-showcase-shelf-back-1    |     user = await crud.user.create(tx, username, password, superuser=superus                                                                                                   er)
shelf-showcase-shelf-back-1    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                   ^^^
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    |   File "/usr/src/shelf-back/app/crud/user.py", line 97, in create
shelf-showcase-shelf-back-1    |     raise errors.UserAlreadyExists(f"Username '{username}' is taken") from                                                                                                    exc
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1    | app.errors.UserAlreadyExists: Username 'admin' is taken
shelf-showcase-shelf-back-1    |
shelf-showcase-shelf-back-1 exited with code 1

But restarting seems to fixed the error

That's strange. It shouldn't be trying to create a user again if it already exists. Anyway, thanks for your patience and checking out the project