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

Fix NPE in schema migration for empty fields #847

Closed
2 tasks done
Jotschi opened this issue Aug 16, 2019 · 0 comments
Closed
2 tasks done

Fix NPE in schema migration for empty fields #847

Jotschi opened this issue Aug 16, 2019 · 0 comments

Comments

@Jotschi
Copy link
Contributor

Jotschi commented Aug 16, 2019

NPE can happen at

return new HtmlFieldImpl().setHTML(typeConverter.toString(oldContent.getFields().getField(fieldName, fieldSchema).getValue()));
when the field container does not yet contain the to be migrated field.

mesh-server      | 20:38:04.880 [] INFO  [vert.x-worker-thread-6] [c.g.m.c.d.j.i.NodeMigrationJobImpl] - Handling node migration request for schema {d7a8c27712304586a8c2771230c586f9} from version {fff5290659934e9eb5290659930e9ec7} to version {aec34c4635884a5f834c4635885a5f2e} for release {795ce1e9b6e1418f9ce1e9b6e1e18f17} in project {44493d95140545a5893d951405b5a5e4}
mesh-server      | 20:38:04.905 [] ERROR [vert.x-worker-thread-6] [c.g.m.c.e.m.n.NodeMigrationHandler] - Error while handling container {8e222d0d6e4d482fa22d0d6e4d282f7c} of node {d729c6c99b394ef5a9c6c99b39def54a} during schema migration.
mesh-server      | java.lang.NullPointerException: null
mesh-server      |      at com.gentics.mesh.core.data.schema.impl.FieldTypeChangeImpl.changeToHtml(FieldTypeChangeImpl.java:229)
mesh-server      |      at com.gentics.mesh.core.data.schema.impl.FieldTypeChangeImpl.createFields(FieldTypeChangeImpl.java:173)
[...]
mesh-server      | 20:38:04.956 [] INFO  [vert.x-worker-thread-6] [c.g.m.c.e.m.AbstractMigrationHandler] - Encountered {4} errors during node migration.
mesh-server      | 20:38:04.971 [] ERROR [vert.x-worker-thread-6] [c.g.m.c.e.m.i.MigrationStatusHandlerImpl] - Error handling migration
mesh-server      | io.reactivex.exceptions.CompositeException: 4 exceptions occurred. 
mesh-server      |      at com.gentics.mesh.core.endpoint.migration.node.NodeMigrationHandler.lambda$migrateNodes$5(NodeMigrationHandler.java:129)
[...]
mesh-server      | 20:38:10.367 [] INFO  [vert.x-worker-thread-13] [i.v.e.w.h.i.LoggerHandlerImpl] - 172.20.0.1 - GET /api/v2/schemas/d7a8c27712304586a8c2771230c586f9?lang=en HTTP/1.1 200 1058 - 4 ms
mesh-server      | 20:38:10.414 [] ERROR [OkHttp http://elasticsearch:9200/...] [c.g.m.s.i.AbstractSearchHandler] - Error while processing search response items
mesh-server      | com.gentics.mesh.core.rest.error.GenericRestException: 400 Bad Request search_error_query params {no such index}
mesh-server      |      at com.gentics.mesh.core.rest.error.Errors.error(Errors.java:86)
[...]
mesh-server      |      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
mesh-server      |      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
mesh-server      |      at java.base/java.lang.Thread.run(Unknown Source)
mesh-server      | 20:38:10.415 [] ERROR [OkHttp http://elasticsearch:9200/...] [c

TODO:

  • Check why this was not covered by tests
  • Fix NPE
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

1 participant