Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Delete All" Button in a Collection fails #1328

Open
KZellweger opened this issue Oct 27, 2023 · 10 comments
Open

"Delete All" Button in a Collection fails #1328

KZellweger opened this issue Oct 27, 2023 · 10 comments

Comments

@KZellweger
Copy link

KZellweger commented Oct 27, 2023

Environment:

Docker Image mongo-express:latest (tested with 1-20 and 1-18 as well)
Docker Image mongo:latest

Expected behavoir:

Pressing "Delete All" in a collection should delete all the documents from the current collection.

image

Actual behavoir

Pressing the button results in a error page.
the query ?key=&value=&type=&query={}&projection=&runAggregate=false is inserted after the collection name in the url

Error Message in the Container Log:

2023-10-27 08:21:27           ...result,
2023-10-27 08:21:27              ^
2023-10-27 08:21:27 
2023-10-27 08:21:27 TypeError: result is not iterable
2023-10-27 08:21:27     at exp._buildMongoQuery (/node_modules/mongo-express/lib/routes/collection.js:84:14)
2023-10-27 08:21:27     at exp.deleteCollection (/node_modules/mongo-express/lib/routes/collection.js:448:23)
2023-10-27 08:21:27     at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
2023-10-27 08:21:27     at next (/node_modules/express/lib/router/route.js:144:13)
2023-10-27 08:21:27     at mongoMiddleware (/node_modules/mongo-express/lib/router.js:260:5)
2023-10-27 08:21:27     at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
2023-10-27 08:21:27     at next (/node_modules/express/lib/router/route.js:144:13)
2023-10-27 08:21:27     at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)
2023-10-27 08:21:27     at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
2023-10-27 08:21:27     at /node_modules/express/lib/router/index.js:284:15```
@rtritto rtritto added the old_docker_version Will be fixed in a newer version of Docker image label Oct 29, 2023
@rtritto
Copy link
Member

rtritto commented Oct 29, 2023

_buildMongoQuery is removed in #1009
Please use a newer Docker image version.

@rtritto rtritto closed this as completed Oct 29, 2023
@KZellweger
Copy link
Author

@rtritto thank you for your response.
I am using the latest image versions

REPOSITORY      TAG       DIGEST                                                                    IMAGE ID       CREATED       SIZE
mongo-express   latest    sha256:05b7441d57d9e0f74f29b04b9a8fda3fabd4bb5021474cec4ab3956b07aed804   156c460699a5   11 days ago   247MB
mongo           latest    sha256:d341a86584b96eb665345a8f5b35fba8695ee1d0618fd012ec4696223a3d6c62   ee3b4d1239f1   2 weeks ago   748MB

Even when i specify the current latest digest from docker hub the error still persists.

# Starts a Mongo DB Server
version: '3.1'

services:
  xenio-mongo-db:
    image: mongo
    restart: always
    container_name: xenio-mongo-db
    ports:
      - "27017:27017"
    volumes:
      - mongo-data:/var/mongo/data
    environment:
      MONGO_INITDB_DATABASE: xenio-db
      MONGO_INITDB_ROOT_USERNAME: admin
      MONGO_INITDB_ROOT_PASSWORD: password

  mongo-express:
    image: mongo-express@sha256:e8f1096fc88d5566df50923b4b3556f74510ae9e0a8f0f29e4b854d444b30b18
    restart: always
    ports:
      - "8081:8081"
    environment:
      ME_CONFIG_MONGODB_ADMINUSERNAME: admin
      ME_CONFIG_MONGODB_ADMINPASSWORD: password
      ME_CONFIG_MONGODB_URL: mongodb://admin:password@xenio-mongo-db:27017/

volumes:
  mongo-data:

@rtritto rtritto removed the old_docker_version Will be fixed in a newer version of Docker image label Oct 30, 2023
@rtritto rtritto reopened this Oct 30, 2023
@rcrvano
Copy link

rcrvano commented Nov 3, 2023

I have the same error with the following configuration:

mongo-express:1.0.0-20-alpine3.18 (26 oct 2023)
mongo 4.4.6

The issue arises when I press the 'Prev' / 'Next' buttons in the page navigator or try to delete records. Here is a screenshot that illustrates the problem:

Screenshot at 2023-11-03 15-22-50

@kaskadz
Copy link

kaskadz commented Nov 10, 2023

I have exactly the same problem with 1-20 in both scenarios: prev/next buttons and delete all.

Here are the logs from when I click delete all:

2023-11-10 16:28:28 /node_modules/mongo-express/lib/routes/collection.js:84
2023-11-10 16:28:28           ...result,
2023-11-10 16:28:28              ^
2023-11-10 16:28:28 
2023-11-10 16:28:28 TypeError: result is not iterable
2023-11-10 16:28:28     at exp._buildMongoQuery (/node_modules/mongo-express/lib/routes/collection.js:84:14)
2023-11-10 16:28:28     at exp.deleteCollection (/node_modules/mongo-express/lib/routes/collection.js:448:23)
2023-11-10 16:28:28     at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
2023-11-10 16:28:28     at next (/node_modules/express/lib/router/route.js:144:13)
2023-11-10 16:28:28     at mongoMiddleware (/node_modules/mongo-express/lib/router.js:260:5)
2023-11-10 16:28:28     at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)

After that mongo-express seems to restart.

@aakrem
Copy link

aakrem commented Dec 10, 2023

same issue here. happens each time I use the delete all button

/node_modules/mongo-express/lib/routes/collection.js:84
          ...result,
             ^

TypeError: result is not iterable
    at exp._buildMongoQuery (/node_modules/mongo-express/lib/routes/collection.js:84:14)
    at exp.deleteCollection (/node_modules/mongo-express/lib/routes/collection.js:448:23)
    at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
    at next (/node_modules/express/lib/router/route.js:144:13)
    at mongoMiddleware (/node_modules/mongo-express/lib/router.js:260:5)
    at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
    at next (/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)
    at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
    at /node_modules/express/lib/router/index.js:284:15

Node.js v18.19.0

@mattclark2500
Copy link

Me too. Exactly same symptoms. I am also using the latest image.

TypeError: result is not iterable
2023-12-19T20:40:51.017491676Z at exp._buildMongoQuery (/node_modules/mongo-express/lib/routes/collection.js:84:14)
2023-12-19T20:40:51.017494510Z at exp.deleteCollection (/node_modules/mongo-express/lib/routes/collection.js:448:23)
2023-12-19T20:40:51.017497301Z at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
2023-12-19T20:40:51.017499968Z at next (/node_modules/express/lib/router/route.js:144:13)
2023-12-19T20:40:51.017502551Z at mongoMiddleware (/node_modules/mongo-express/lib/router.js:260:5)
2023-12-19T20:40:51.017505218Z at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
2023-12-19T20:40:51.017507885Z at next (/node_modules/express/lib/router/route.js:144:13)
2023-12-19T20:40:51.017536176Z at Route.dispatch (/node_modules/express/lib/router/route.js:114:3)
2023-12-19T20:40:51.017539301Z at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
2023-12-19T20:40:51.017541968Z at /node_modules/express/lib/router/index.js:284:15
2023-12-19T20:40:51.017544551Z
2023-12-19T20:40:51.017548551Z Node.js v18.19.0

@aakrem
Copy link

aakrem commented Dec 20, 2023

btw using this older image fixes the issue if you don't need the very latest changes:

mongo-express:0.54.0

@toastxc
Copy link

toastxc commented Dec 26, 2023

I'm having the same issue on the container version: 1.0.0-18-alpine3.18
Are there any temporary workarounds?

@Loenus
Copy link

Loenus commented Dec 29, 2023

same issue on container version 1.0.0-20-alpine3.18

@doebi
Copy link

doebi commented Jan 7, 2024

Still the same issue with the latest image 1 day ago:

docker image inspect a7a234790da6

...
"Created": "2024-01-06T01:16:53.955438117Z",
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants