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

Projects with timezone in modified time metadata are not displayed in Open Project #1386

Closed
ostephens opened this issue Dec 18, 2017 · 12 comments
Assignees
Labels
metadata Adding metadata to projects, columns and other parts of the data model Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Milestone

Comments

@ostephens
Copy link
Sponsor Member

ostephens commented Dec 18, 2017

This is on the current Master branch with new Tags functionality implemented. None of my projects created on a pre-tags version of OR display in the Open Project screen. However, projects created with the Tags version of OR do display even if no tags assigned.

The 'All' option should display all projects, no matter whether any Tags metadata exists or not.

@ostephens ostephens added the Type: Bug Issues related to software defects or unexpected behavior, which require resolution. label Dec 18, 2017
@jackyq2015
Copy link
Contributor

Not sure if it is caused by merge or not. let me check and update.

@jackyq2015 jackyq2015 self-assigned this Dec 18, 2017
@jackyq2015
Copy link
Contributor

jackyq2015 commented Dec 18, 2017

@ostephens Did you see any exception at back end? could you please paste the console message while startup? I have no problem to show "All" projects. But I cannot add tags anymore. can somebody confirm?

@ostephens
Copy link
Sponsor Member Author

No exceptions or issues flagged in the console. However, checking I can see that get-all-project-metadata is coming back with an empty list:

{"projects":{}}

@ostephens
Copy link
Sponsor Member Author

OK, think I have tracked down the issue to the parsing of the "modified" date from the project metadata.json. This happens in ParsingUtilities.stringToLocalDate(String s)

static public LocalDateTime stringToLocalDate(String s) {
      System.err.println(LocalDateTime.parse(s, DateTimeFormatter.ISO_LOCAL_DATE_TIME));
      return LocalDateTime.parse(s, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
    }

The string is going in, but nothing is being returned (which I think leads the creation of the projectmetadata to fail in ProjectMetadata.loadFromJson"

ProjectMetadata pm = new ProjectMetadata(JSONUtilities.getLocalDate(obj, "modified", LocalDateTime.now()));

The issue seems to be that the existing metadata.json records time with strings like:
"modified": "2014-01-15T21:46:25Z",

But LocalDateTime.parse(s, DateTimeFormatter.ISO_LOCAL_DATE_TIME); requires it to have no timezone information.

If I manually edit the metadata.json to read:
"modified": "2014-01-15T21:46:25",
The project displays OK in the UI

@jackyq2015
Copy link
Contributor

jackyq2015 commented Dec 19, 2017

@ostephens May I know your version of Java while you created those old projects? It is a regression introduced by local time stamp. I had a UT for testing the new API can parse the old project. but still missed something. will figure out and close it.

@ostephens ostephens changed the title Projects without tags set are not displayed in Open Project Projects with timezone in modified time metadata are not displayed in Open Project Dec 19, 2017
jackyq2015 added a commit to jackyq2015/OpenRefine that referenced this issue Dec 19, 2017
@ostephens
Copy link
Sponsor Member Author

@jackyq2015 I have projects created over a long period - I don't know which version of Java or OR I was using with them I'm afraid

@jackyq2015
Copy link
Contributor

that is fine. no worry, Owen!

jackyq2015 added a commit that referenced this issue Dec 21, 2017
@ettorerizza
Copy link
Member

ettorerizza commented Dec 23, 2017

@ostephens I tested yesterday the development version by adding tags to a project already created, and now I get this bug when I try to open the project in question in the stable version 2.8. Is it a related issue?

Note : I can open the project without problem in the development version.

java.lang.NullPointerException
        at java.util.Calendar.setTime(Unknown Source)
        at java.text.SimpleDateFormat.format(Unknown Source)
        at java.text.SimpleDateFormat.format(Unknown Source)
        at java.text.DateFormat.format(Unknown Source)
        at com.google.refine.util.ParsingUtilities.dateToString(ParsingUtilities.java:177)
        at com.google.refine.history.HistoryEntry.write(HistoryEntry.java:112)
        at com.google.refine.history.History.write(History.java:270)
        at com.google.refine.commands.Command.respondJSON(Command.java:311)
        at com.google.refine.commands.Command.respondJSON(Command.java:297)
        at com.google.refine.commands.history.GetHistoryCommand.doGet(GetHistoryCommand.java:54)
        at com.google.refine.RefineServlet.service(RefineServlet.java:170)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
        at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
        at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:132)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
22:46:21.738 [                   refine] GET /command/core/get-history (270ms)
22:46:21.742 [          org.mortbay.log] /command/core/get-history (4ms)
java.lang.NullPointerException
        at java.util.Calendar.setTime(Unknown Source)
        at java.text.SimpleDateFormat.format(Unknown Source)
        at java.text.SimpleDateFormat.format(Unknown Source)
        at java.text.DateFormat.format(Unknown Source)
        at com.google.refine.util.ParsingUtilities.dateToString(ParsingUtilities.java:177)
        at com.google.refine.history.HistoryEntry.write(HistoryEntry.java:112)
        at com.google.refine.history.History.write(History.java:270)
        at com.google.refine.commands.Command.respondJSON(Command.java:311)
        at com.google.refine.commands.Command.respondJSON(Command.java:297)
        at com.google.refine.commands.history.GetHistoryCommand.doGet(GetHistoryCommand.java:54)
        at com.google.refine.RefineServlet.service(RefineServlet.java:170)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
        at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
        at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:132)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

@jackyq2015
Copy link
Contributor

I guess this project is created using the new version of refine. if so, the reason is that the old API in jdk 7 can not process the date time written from jdk8. but from vise versa is fine. since jdk 7 was dropped already, I will mark it as not fix if it is the case.

@ettorerizza
Copy link
Member

@jackyq2015 Yes, looks like projects (or only some projects, don't know) created with the development version can not be opened in previous versions. This is a major change that will need to be reported in bold to users. For example, we can no longer advise those who want to use the RDF extension to export their project and re-import it into LODRefine. cc @ostephens

@jackyq2015
Copy link
Contributor

jackyq2015 commented Dec 28, 2017

@ettorerizza Do you have the instruction to do the export/import somewhere(include versions information)? I can take a look. The back capability is possible if there is a need. The thing is that every change to the core could potentially break other extensions. Since we don't have the full picture and usage of those extensions, it is a little bit hard to do the major change and also keep all the back capability at the same time.

@ostephens
Copy link
Sponsor Member Author

I think breaking backwards compatibility with previous versions of OpenRefine is a very bad idea. OpenRefine 2.5 no longer works on my Mac, so I can't go back and do an export/import for older projects.

I think definitely newer versions of OpenRefine should open projects created in older versions of OpenRefine.

I can see an argument for saying that projects created in more recent versions of OpenRefine may not open in older versions - that feels a less problematic breaking change, although still I think we should avoid this where possible

wetneb pushed a commit that referenced this issue Feb 2, 2018
* fix the appbundle issue #1209

* fix #1162

allow the JRE 9

* fix the package declarations

* remove the _ from the method name

* use the explicit scoping

* remote extra ;

* fix issued from codacy

* fix issued from codacy

* add preferences link to the index page

* handle the empty user metadata

* fix 'last modified' sorting issue #1307

* prevent overflow of the table. issue #1306

* add isoDateParser to sort the date

* prevent overflow of the project index

* remove sorter arrow for action columns

* disable editing the internal metadata

* adjust the width of the table

* change MetaData to Metadata

* change the filed name from rowNumber to rowCount

* put back the incidently deleted gitignore

* add double quote to prevent word splitting

* UI improvement on metadata view and project list view

* remove the date field in metadata

* message notification of the free RAM. Issue #1295

* UI tuning for metadata view

* shorten the ISO date to locale date format

* Added translation using Weblate (Portuguese (Brazil))

* remove the rename link

* Ignore empty language files introduced by Weblate

* Add UI for Invert text filter

* Backend support for Inverting Text search facets

* Fix reset on text search facet

* More succinct return statements

* add tests for SetProjectMetadataCommand

* Tidying up for Codacy

* Added Tests for TextSearchFilter

* Corrections for Codacy

* More code tidy up

* let the browser auto fit the table cell when resizing/zooming

* fix import multiple excel with mulitple sheets issue #1328

* check if the project has the userMetadata

* fix the unit test
support multi files with multi tables for open office

* prevent the same key for user metadata

* replace _ with variable for exception

* fix the no-undef issue

* to adjust the width of transform dialog. issue #1332

* fix the row count refresh issue

* extract method

* move the log message

* cosmatic changes for codacy

* fix typo

* bump to version 2.8

* .gitignore is now working

* preview stage won't have the metadata populated, so protect NPE

* Update README.md

No more direct link to the last version tag, which will avoid having to think of updating the readme

* refacotring the ProjectMetadata class

* introduce the IMetadata interface

* create submodule of dataschema

* add back

* setup lib for dataschema; upgrade the apache lang to lang3

* replace escape* functions from apache lang3

* replace the ProjectMetadata with IMetadata interface

* add missing jars

* set the IMetadata a field of Project

* remove PreferenceStore out of Project model

* fix test SetProjectMetadataCommandTests by casting

* introdcue the AbstractMetadata

* introdcue the AbstractMetadata

* reorganize the metadata package

* allow have mulitiple metadata for a project

* support for mulitple metadata format

* remove jdk7 since 'table schema' java implmentation only support jdk8+

* set execute permission for script

* fix the Unit Test after Metadata refactoring

* restore the apache lang2.5 since jetty 6.1.22 depend on it

* add commons lang 2.5 jar

* git submodule add  https://github.com/frictionlessdata/datapackage-java

* remove the metadata parameter from the ProjectManager.registerProject method

* remove hashmap _projectsMetadata field from the ProjectManager and FileProjectManager

* init the Project.metadataMap

* fix Unit Test

* restore the ProjectMetaData map to ProjectManager

* put the ProjectMetaDta in place for ProjectManager and Project object

* check null of singleton instead of create a constructor just for test

* load the data package metadata

* importing data package

* importing data package

* encapsulate the Package class into DataPackageMetadata

* user _ to indicate the class fields

* introduce base URL in order to download the data files

* import data package UI and draft backend

* import data package UI

* fix typo

* download the data set pointed from metadata resource

* save and load the data package metadata

* avoid magic string

* package cleanup

* set the java_version to 1.8

* set the min jdk to 1.8

* add the 3rd party src in the build.xml

* skip the file selection page if only 1 DATA file

* add files structure for json editor

* seperate out the metadata file from the retrival file list

* rename the OKF_METADATA to DATAPACKAGE_METADATA

* clean up

* implement GetMetadateCommand class

* display the metadata in json format

* git submodule update --remote --merge

* adjust the setting after pulling from datapackage origin

* fix the failed UT DateExtensionTests.testFetchCounts due to new json jar json-20160810.jar will complain: JSONObject["float"] not a string.

* clean up the weird loop array syntax get complained

* remove the unused constant

* export in data package format

* interface cleanup

* fix UT

* edit the metadata

* add UT for SetMetadataCommand

* fix UT for SetMetadataCommand

* display the data package metadata link on the project index page

* update submodule

* log the exceptions

* Ajv does not work properly, use the back end validation instead

* enable the validation for jsoneditor

* first draft of the data validation

* create a map to hold the constraint and its handler

* rename

* support for minLength and maxLength from spec

* add validate command

* test the opeation instead of validate command

* rename the UT

* format the error message and push to the report

* fix row number

* add resource bundle for validator

* inject the code of the constrains

* make the StrSubstitutor works

* extract the type and format information

* add the customizedFormat to interface to allow format properly

* get rid of magic string

* take care of missing parts of the data package

* implement RequiredConstraint

* patch for number type

* add max/min constraints

* get the constrains directly from field

* implement the PatternConstraint

* suppress warning

* fix the broken UT when expecting 2 digits fraction

* handle the cast and type properly

* fix the missing resource files for data package when run from command line

* use the copy instead of copydir

* add script for appveyor

* update script for appveyor

* do recursive clone

* correct the git url

* fix clone path

* clone folder option does not work

* will put another PR for this. delete for now

* revert the interface method name

* lazy loading the project data

* disable the validate menu for now

* add UT

* assert UTs

* add UT

* fix #1386

* remove import

* test the thread

* Revert "test the thread"

This reverts commit 7792141.

* fix the URLCachingTest UT

* define the template data package

* tidy up the metadata interface

* check the http response code

* fix the package

* display user friendly message when URL path is not reachable

* populate the data package schema

* Delete hs_err_pid15194.log

* populate data package info

* add username  preference and it will be pulled as the creator of the metadata

* undo the project.updateColumnChange() and start to introduce the fields into the existing core model

* tightly integrate the data package metadata

* tightly integrate the data package metadata for project level

* remove the submodule

* move the edit botton

* clean up build

* load the new property

* load the project metadata

* fix issues from codacy

* remove unused fields and annotation

* check the http response code firstly

* import zipped data package

* allow without keywords

* process the zip data package from url

* merge the tags

* check store firstly

* remove the table schema src

* move the json schema files to schema dir

* add comment

* add comment

* remove git moduels

* add incidently deleted file

* fix typo

* remove SetMetadataCommand

* revert change

* merge from master
@thadguidry thadguidry added this to the 3.0 milestone May 26, 2018
@thadguidry thadguidry added this to TODO in Google Sponsored Projects via automation May 26, 2018
@thadguidry thadguidry added the metadata Adding metadata to projects, columns and other parts of the data model label May 26, 2018
@thadguidry thadguidry moved this from TODO to Done in Google Sponsored Projects May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata Adding metadata to projects, columns and other parts of the data model Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Projects
No open projects
Development

No branches or pull requests

4 participants