XMLDocumentManager.exists() may throw exceptions on server side

When checking for documents to exist in our MarkLogic server database we tend to use
XMLDocumentManager#exists(String... uris). This method call produces a REST request ending up in /MarkLogic/rest-api/models/document-model-query.xqy.
Our problem is, that if the document (to check for) is missing then this method then produces a ~5000 character long error stacktrace, polluting our server side logs.
I did create an issue for MarkLogic Server (Case 01571131) because using exceptions as control flow is - simply put - bad software design. And why should an exception be thrown anyway? Either a document exists or it doesn't. Nothing surprising or exceptional about it.
I'm raising this issue here because maybe there are other REST-API-methods to chose from? Maybe there is something less intrusive? - Don't know.
Meanwhile we are tempted to no longer use XMLDocumentManager#exists(String... uris) but instead perform an eval-script which checks for a document without so much noice.
Thoughts?
PS: Using marklogic-java-client in version 7.0.0 and ML server in version 11.3.1

Hey @ralfhergert - I'm not able to get that same stacktrace. The exists(String) method is sending a HEAD request to v1/documents. I can do the same thing with curl:
curl --head --anyauth -u admin:admin "http://localhost:8004/v1/documents?uri=/missing.xml"

And I see the following in my 8004 access logs, with nothing written to the error log:
<IP_ADDRESS> - - [03/Dec/2024:17:12:56 +0000] "HEAD /v1/documents?uri=/missing.xml HTTP/1.1" 401 0 - "curl/8.7.1"
<IP_ADDRESS> - admin [03/Dec/2024:17:12:56 +0000] "HEAD /v1/documents?uri=/missing.xml HTTP/1.1" 404 0 - "curl/8.7.1"

For other options, particularly if you want to check the existence of multiple URIs - I would consider an Optic query for that - e.g. something like this (which you can construct using the Java PlanBuilder too):
op.fromSearchDocs(cts.documentQuery(/*put each URI in here*/))
  .select(["uri"])

That would return each URI that exists.

Thank you for your quick response, @rjrudin
Just testing with a curl statement is a good idea, I tried that, and I could find the accoring error message in my logs:
2024-12-04 11:22:56.826 Notice: RESTAPI-NODOCUMENT: (err:FOER0000) Resource or document does not exist:  category: content message: /missing.xml
2024-12-04 11:22:56.826 Notice:+in /MarkLogic/rest-api/models/document-model-query-head.xqy, at 78:13,
2024-12-04 11:22:56.826 Notice:+in docmodqryhead:head(map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../>), map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../>)) [1.0-ml]
2024-12-04 11:22:56.826 Notice:+  $headers = map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../>)
2024-12-04 11:22:56.826 Notice:+  $params = map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../>)
2024-12-04 11:22:56.826 Notice:+  $uri = "/missing.xml"
2024-12-04 11:22:56.826 Notice:+  $uri-format = "xml"
2024-12-04 11:22:56.826 Notice:+  $accept-type = ()
2024-12-04 11:22:56.826 Notice:+  $doc = ()
2024-12-04 11:22:56.826 Notice:+  $response-format = "xml"
2024-12-04 11:22:56.826 Notice:+  $uri-type = "application/xml"
2024-12-04 11:22:56.826 Notice:+  $response-type = "application/xml"
2024-12-04 11:22:56.826 Notice:+  $skip-etag = fn:false()
2024-12-04 11:22:56.826 Notice:+  $version = ()
2024-12-04 11:22:56.826 Notice:+  $is-available = fn:false()
2024-12-04 11:22:56.826 Notice:+in /MarkLogic/rest-api/endpoints/document-item-query-head.xqy, at 48:9 [1.0-ml]

I think in order to see this error message, "System Level Logs" must be configured to show at least "NOTICE". (Not sure whether this is the case by default.)
But thanks for your hints on alternative methods to test for document existence. I'll give it a shot.
Closing this issue.


Recipe testing and comparison for release 2.11.0

Path to the output directories on DKRZ/Levante:
/scratch/b/b382148/esmvaltool_output
System and settings
environment_v2.11.0.txt
levante6> mamba --version
mamba 1.5.8
conda 24.5.0

levante6> esmvaltool version
ESMValCore: 2.11.0rc2.dev3+g20ae705fe
ESMValTool: 2.11.0.dev78+g4ab64905c.d20240523

This is what @ehogan did on DKRZ: https://github.com/ESMValGroup/ESMValCore/discussions/2389#discussioncomment-9469188
Recipe running session 2024-05-24 10:41:05.726830
Recipes that ran successfully (136 out of 160)

Click to expand

recipe_albedolandcover.yml
recipe_anav13jclim.yml
recipe_arctic_ocean.yml
recipe_autoassess_landsurface_permafrost.yml
recipe_autoassess_landsurface_soilmoisture.yml
recipe_autoassess_landsurface_surfrad.yml
recipe_autoassess_stratosphere.yml
recipe_bock20jgr_fig_1-4.yml
recipe_bock20jgr_fig_6-7.yml
recipe_capacity_factor.yml
recipe_climate_change_hotspot.yml
recipe_climwip_brunner2019_med.yml
recipe_climwip_brunner20esd.yml
recipe_climwip_test_basic.yml
recipe_climwip_test_performance_sigma.yml
recipe_clouds_bias.yml
recipe_clouds_ipcc.yml
recipe_cmug_h2o.yml
recipe_concatenate_exps.yml
recipe_consecdrydays.yml
recipe_correlation.yml
recipe_cox18nature.yml
recipe_cvdp.yml
recipe_daily_era5.yml
recipe_deangelis15nat.yml
recipe_deangelis15nat_fig1_fast.yml
recipe_decadal.yml
recipe_diurnal_temperature_index.yml
recipe_eady_growth_rate.yml
recipe_ecs.yml
recipe_ecs_constraints.yml
recipe_ecs_scatter.yml
recipe_ensclus.yml
recipe_era5-land.yml
recipe_esacci_lst.yml
recipe_esacci_oc.yml
recipe_extract_shape.yml
recipe_extreme_index.yml
recipe_eyring06jgr.yml
recipe_flato13ipcc_figure_914.yml
recipe_flato13ipcc_figure_924.yml
recipe_flato13ipcc_figure_942.yml
recipe_flato13ipcc_figure_945a.yml
recipe_flato13ipcc_figure_96.yml
recipe_flato13ipcc_figure_98.yml
recipe_flato13ipcc_figures_926_927.yml
recipe_flato13ipcc_figures_92_95.yml
recipe_flato13ipcc_figures_938_941_cmip3.yml
recipe_flato13ipcc_figures_938_941_cmip6.yml
recipe_galytska23jgr.yml
recipe_gier2020bg.yml
recipe_globwat.yml
recipe_heatwaves_coldwaves.yml
recipe_hydro_forcing.yml
recipe_hyint.yml
recipe_hyint_extreme_events.yml
recipe_hype.yml
recipe_iht_toa.yml
recipe_impact.yml
recipe_ipccwg1ar6ch3_fig_3_43.yml
recipe_ipccwg1ar6ch3_fig_3_9.yml
recipe_julia.yml
recipe_kcs.yml
recipe_landcover.yml
recipe_lauer13jclim.yml
recipe_lauer22jclim_fig1_clim.yml
recipe_lauer22jclim_fig1_clim_amip.yml
recipe_lauer22jclim_fig2_taylor.yml
recipe_lauer22jclim_fig2_taylor_amip.yml
recipe_lauer22jclim_fig6_interannual.yml
recipe_lauer22jclim_fig7_seas.yml
recipe_lauer22jclim_fig8_dyn.yml
recipe_lauer22jclim_fig9-11c_pdf.yml
recipe_li17natcc.yml
recipe_lisflood.yml
recipe_marrmot.yml
recipe_meehl20sciadv.yml
recipe_model_evaluation_basics.yml
recipe_model_evaluation_clouds_clim.yml
recipe_model_evaluation_clouds_cycles.yml
recipe_model_evaluation_precip_zonal.yml
recipe_modes_of_variability.yml
recipe_monitor.yml
recipe_monitor_with_refs.yml
recipe_mpqb_xch4.yml
recipe_multimodel_products.yml
recipe_my_personal_diagnostic.yml
recipe_ncl.yml
recipe_ocean_Landschuetzer2016.yml
recipe_ocean_amoc.yml
recipe_ocean_bgc.yml
recipe_ocean_example.yml
recipe_ocean_ice_extent.yml
recipe_ocean_multimap.yml
recipe_ocean_scalar_fields.yml
recipe_perfmetrics_CMIP5.yml
recipe_perfmetrics_CMIP5_4cds.yml
recipe_perfmetrics_land_CMIP5.yml
recipe_preprocessor_test.yml
recipe_psyplot.yml
recipe_pv_capacity_factor.yml
recipe_python.yml
recipe_python_for_CI.yml
recipe_quantilebias.yml
recipe_r.yml
recipe_radiation_budget.yml
recipe_rainfarm.yml
recipe_runoff_et.yml
recipe_russell18jgr.yml
recipe_schlund20esd.yml
recipe_schlund20jgr_gpp_abs_rcp85.yml
recipe_schlund20jgr_gpp_change_1pct.yml
recipe_schlund20jgr_gpp_change_rcp85.yml
recipe_sea_surface_salinity.yml
recipe_seaborn.yml
recipe_seaice.yml
recipe_seaice_drift.yml
recipe_seaice_feedback.yml
recipe_shapeselect.yml
recipe_smpi.yml
recipe_smpi_4cds.yml
recipe_snowalbedo.yml
recipe_spei.yml
recipe_tcr.yml
recipe_thermodyn_diagtool.yml
recipe_toymodel.yml
recipe_validation.yml
recipe_validation_CMIP6.yml
recipe_variable_groups.yml
recipe_weigel21gmd_figures_13_16.yml
recipe_wenzel14jgr.yml
recipe_wenzel16jclim.yml
recipe_wenzel16nat.yml
recipe_wflow.yml
recipe_williams09climdyn_CREM.yml
recipe_zmnam.yml

Recipes that failed because the diagnostic script failed (7 out of 160)

recipe_combined_indices.yml
recipe_extreme_events.yml
recipe_martin18grl.yml
recipe_miles_block.yml
recipe_miles_eof.yml
recipe_miles_regimes.yml
recipe_pcrglobwb.yml

Recipes that failed because of missing data (3 out of 160)

recipe_aod_aeronet_assess.yml
recipe_bock20jgr_fig_8-10.yml
recipe_check_obs.yml

Recipes that failed because the run took too long (4 out of 160)

recipe_eyring13jgr_12.yml
recipe_ipccwg1ar6ch3_fig_3_19.yml
recipe_ipccwg1ar6ch3_fig_3_42_a.yml
recipe_lauer22jclim_fig5_lifrac.yml

Recipes that failed because they used too much memory (2 out of 160)

recipe_ipccwg1ar6ch3_fig_3_42_b.yml
recipe_lauer22jclim_fig3-4_zonal.yml

Recipes that failed of other reasons or are still running (8 out of 160)

recipe_carvalhais14nat.yml
recipe_collins13ipcc.yml
recipe_easy_ipcc.yml
recipe_ipccwg1ar6ch3_atmosphere.yml
recipe_lauer22jclim_fig9-11ab_scatter.yml
recipe_ocean_quadmap.yml
recipe_preprocessor_derive_test.yml
recipe_tebaldi21esd.yml

Analysis of failures are detailed here https://github.com/ESMValGroup/ESMValCore/issues/2421#issuecomment-2115103294

Thanks for the check!
recipe_martin18grl.yml
fails because of some issue with the provenance, looks like some check got more strict and found some before not noticed issue with filenames. I'll have a look at it.

Thanks for the check! recipe_martin18grl.yml fails because of some issue with the provenance, looks like some check got more strict and found some before not noticed issue with filenames. I'll have a look at it.

Unfo

Un

Sorry, somehow I hit the wrong button when I tried to remove a comment.
Unfortunately, the issue with recipe_martin18grl.yml is more complicated than I thought before. The reason that it cannot write the figure/provenance is, that the name of some models is not found correctly anymore in droughtindex/collect_drought_.py. The way these python diagnostics identified the models was never really good: Since the data are previously modified by the R script (diag_save_spi.R) and forwarded through ancestors in the recipe, the information about the model name was not in the cfg automatically, so I used the  information in cube [model_id or source_id in cube.metadata.attributes after iris.load]. (This was never a really good idea, because due to the different keys in the attributes, it only worked for CMIP5 and CMIP6 models). Unfortunately, now this information is not there anymore for some CMIP5 models (e.g. GISS-E2-H) for others it still works. The reason could be somewhere in the R script, or even already in the preprocessor? (And I'm not sure if it would not be better to improve the way the python script gets its information instead of fixing it in R).

cube.metadata.attributes
for GISS-E2-H
{'Conventions': 'CF-1.7', 'title': 'GISS-E2-H model output prepared for CMIP5 historical', 'software': 'Created with ESMValTool v2.11.0rc2.dev3+g20ae705fe', 'caption': 'SPI index per grid point.'}
cube.metadata.attributes
for ACCESS1.3
{'Conventions': 'CF-1.7', 'branch_time': 90945.0, 'cmor_version': '2.8.0', 'contact': 'The ACCESS wiki: http://wiki.csiro.au/confluence/display/ACCESS/Home. Contact<EMAIL_ADDRESS>regarding the ACCESS coupled climate model. Contact<EMAIL_ADDRESS>regarding ACCESS coupled climate model CMIP5 datasets.', 'experiment': 'historical', 'experiment_id': 'historical', 'forcing': 'GHG, Oz, SA, Sl, Vl, BC, OC, (GHG = CO2, N2O, CH4, CFC11, CFC12, CFC113, HCFC22, HFC125, HFC134a)', 'frequency': 'mon', 'initialization_method': 1, 'institute_id': 'CSIRO-BOM', 'institution': 'CSIRO (Commonwealth Scientific and Industrial Research Organisation, Australia), and BOM (Bureau of Meteorology, Australia)', 'model_id': 'ACCESS1.3', 'modeling_realm': 'atmos', 'parent_experiment': 'pre-industrial control', 'parent_experiment_id': 'piControl', 'parent_experiment_rip': 'r1i1p1', 'physics_version': 1, 'product': 'output', 'project_id': 'CMIP5', 'realization': 1, 'references': 'See http://wiki.csiro.au/confluence/display/ACCESS/ACCESS+Publications', 'source': 'ACCESS1-3 2011. Atmosphere: AGCM v1.0 (N96 grid-point, 1.875 degrees EW x approx 1.25 degree NS, 38 levels); ocean: NOAA/GFDL MOM4p1 (nominal 1.0 degree EW x 1.0 degrees NS, tripolar north of 65N, equatorial refinement to 1/3 degree from 10S to 10 N, cosine dependent NS south of 25S, 50 levels); sea ice: CICE4.1 (nominal 1.0 degree EW x 1.0 degrees NS, tripolar north of 65N, equatorial refinement to 1/3 degree from 10S to 10 N, cosine dependent NS south of 25S); land: CABLE1.0 (1.875 degree EW x 1.25 degree NS, 6 levels', 'table_id': 'Table Amon (27 April 2011) 9c851218e3842df9a62ef38b1e2575bb', 'title': 'ACCESS1-3 model output prepared for CMIP5 historical', 'version_number': 'v20120413', 'software': 'Created with ESMValTool v2.11.0rc2.dev3+g20ae705fe', 'caption': 'SPI index per grid point.'}

@lukruh I think you had a better method to forward information when using ancestors?

It looks like it comes already out of the preprocessor:
The input data contain all necessary global attributes, the preprocessed data do not; instead the former global attributes are listed as attributes of the variable (pr), see file attached.
recipe_martin18grl_issue_with_attributes.txt

Thanks to those who have checked recipes so far! Please keep checking, we are aiming to finalise the release process on Thursday this week :slightly_smiling_face:

Apologies for the late answer, I was on vacation.

recipe_ecs_constraints.yml and recipe_schlund20esd.yml: the plot for the Su et al. emergent constraints is vastly different in v2.11.0. Something is very wrong here.

Pre-v2.11.0:

v2.11.0:

I have not idea what's causing this. Try to have a look at this tomorrow.

recipe_monitor_with_refs.yml: The tick labels of the time axis overlap, this can probably be fixed very easily.

Known broken recipes (3 recipes)
* recipe_psyplot.yml

recipe_psyplot.yml ran successfully, why is it listed as broken here?

Closing this issue now the release has been completed 👍


Error: Request failed with status code 500. "KeyError: 'tf_detection_api'\n".

My actions before raising this issue

[ ] Read/searched the docs
[ ] Searched past issues

Expected Behaviour

Current Behaviour

Steps to Reproduce (for bugs):
Steps:

install CVAT tool on Ubuntu
Restart PC/System
Run CVAT Tool
Try to export or dump dataset as Tfrecords

Context

Your Environment
Operating System: Ubuntu 20.04 LTS

Hi, do you have tensorflow installed?

@zhiltsov-max , can you reproduce the behaviors?

There is not enough information to reproduce.

@patankar-anant123 , don't hesitate to re-open the issue if you can provide more information how to reproduce the issue.

I just had the same error message and digging through the logs it looked like the main cvat container was unable to talk to redis. According to docker-compose ps all containers were running normally, but this was after a server reboot, so I assume docker brought the containers back up instead of docker-compose and something must have been a little off.
I restarted everything with docker-compose down ; docker-compose up -d and tfrecord downloads started working again.


Error when running db-update and using MySQL

Hi!
I'm trying to run the app un production mode using MySQL, and when the db-update script runs I keep getting the following error
`
[4mSequelize [Node: 6.10.3, CLI: 2.5.1, ORM: 3.34.0, mysql: ^2.16.0]
Loaded configuration file "config/db.json".
Using environment "production".
== 20171219-allowance-adjustment-per-year: migrating =======
{ SequelizeDatabaseError: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint
at Query.formatError (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query. (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/app/timeoff-management/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:547:20)
name: 'SequelizeDatabaseError',
message: 'ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint',
parent:
{ Error: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint
at Query.Sequence._packetToError (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:547:20)
--------------------
at Protocol._enqueue (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Connection.query (/app/timeoff-management/node_modules/mysql/lib/Connection.js:200:25)
at /app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:40:21
at Promise._execute (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:79:10)
at Query.run (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:39:17)
at /app/timeoff-management/node_modules/sequelize/lib/sequelize.js:849:20
at /app/timeoff-management/node_modules/retry-as-promised/index.js:39:21
at Promise._execute (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/promise.js:79:10)
at retryAsPromised (/app/timeoff-management/node_modules/retry-as-promised/index.js:29:10)
at /app/timeoff-management/node_modules/sequelize/lib/sequelize.js:848:12
at tryCatcher (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:694:18)
at _drainQueueStep (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
code: 'ER_CANNOT_ADD_FOREIGN',
errno: 1215,
sqlMessage: 'Cannot add foreign key constraint',
sqlState: 'HY000',
index: 0,
sql: 'CREATE TABLE IF NOT EXISTS user_allowance_adjustment (id INTEGER NOT NULL auto_increment , year INTEGER NOT NULL DEFAULT '2019', adjustment INTEGER NOT NULL DEFAULT 0, carried_over_allowance INTEGER NOT NULL DEFAULT 0, created_at DATETIME NOT NULL, user_id INTEGER, PRIMARY KEY (id), FOREIGN KEY (user_id) REFERENCES Users (id) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;' },
original:
{ Error: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint
at Query.Sequence._packetToError (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:547:20)
--------------------
at Protocol._enqueue (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Connection.query (/app/timeoff-management/node_modules/mysql/lib/Connection.js:200:25)
at /app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:40:21
at Promise._execute (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:79:10)
at Query.run (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:39:17)
at /app/timeoff-management/node_modules/sequelize/lib/sequelize.js:849:20
at /app/timeoff-management/node_modules/retry-as-promised/index.js:39:21
at Promise._execute (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/promise.js:79:10)
at retryAsPromised (/app/timeoff-management/node_modules/retry-as-promised/index.js:29:10)
at /app/timeoff-management/node_modules/sequelize/lib/sequelize.js:848:12
at tryCatcher (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:694:18)
at _drainQueueStep (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
code: 'ER_CANNOT_ADD_FOREIGN',
errno: 1215,
sqlMessage: 'Cannot add foreign key constraint',
sqlState: 'HY000',
index: 0,
sql: 'CREATE TABLE IF NOT EXISTS user_allowance_adjustment (id INTEGER NOT NULL auto_increment , year INTEGER NOT NULL DEFAULT '2019', adjustment INTEGER NOT NULL DEFAULT 0, carried_over_allowance INTEGER NOT NULL DEFAULT 0, created_at DATETIME NOT NULL, user_id INTEGER, PRIMARY KEY (id), FOREIGN KEY (user_id) REFERENCES Users (id) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;' },
sql: 'CREATE TABLE IF NOT EXISTS user_allowance_adjustment (id INTEGER NOT NULL auto_increment , year INTEGER NOT NULL DEFAULT '2019', adjustment INTEGER NOT NULL DEFAULT 0, carried_over_allowance INTEGER NOT NULL DEFAULT 0, created_at DATETIME NOT NULL, user_id INTEGER, PRIMARY KEY (id), FOREIGN KEY (user_id) REFERENCES Users (id) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;' }
`
Seems like the table creation sequence is not right, am I missing something? Any help will be highly appreciated, thanks in advance.

Hi @fparente1 - which version of the application are you trying to run? I had the same issue using the 0.10 tag - however, using current master worked fine for me.

Hi @zefixlluja thanks for coming back :) I apologise for my late response, I was on holidays.
I am using the latest from master too.

I just noticed that the error I;m getting today is slightly different, but still related to DB missing entities.
`
========= RUNNING DB-UPDATE =========

<EMAIL_ADDRESS>db-update /app/timeoff-management
node node_modules/.bin/sequelize db:migrate --config=config/db.json --models-path=lib/model/db/

Sequelize [Node: 8.14.0, CLI: 2.5.1, ORM: 3.34.0, mysql: ^2.16.0]
Loaded configuration file "config/db.json".
Using environment "production".
==<PHONE_NUMBER>4054-add_default_date_format: migrating =======
Unhandled rejection SequelizeDatabaseError: ER_NO_SUCH_TABLE: Table 'timeoffmanagement.Companies' doesn't exist
at Query.formatError (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query. (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/app/timeoff-management/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
==<PHONE_NUMBER>4054-add_default_date_format: migrated (0.055s)
==<PHONE_NUMBER>0832-rename_allowence_to_allowance: migrating =======
Unhandled rejection SequelizeDatabaseError: ER_NO_SUCH_TABLE: Table 'timeoffmanagement.Departments' doesn't exist
at Query.formatError (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query. (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/app/timeoff-management/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
==<PHONE_NUMBER>0832-rename_allowence_to_allowance: migrated (2.095s)
== 20170530-add_auto_approve_flag_to_user: migrating =======
Unhandled rejection SequelizeDatabaseError: ER_NO_SUCH_TABLE: Table 'timeoffmanagement.Users' doesn't exist
at Query.formatError (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query. (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/app/timeoff-management/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
== 20170530-add_auto_approve_flag_to_user: migrated (0.034s)
== 20171218-company-wide-message: migrating =======
Unhandled rejection SequelizeDatabaseError: ER_NO_SUCH_TABLE: Table 'timeoffmanagement.Companies' doesn't exist
at Query.formatError (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query. (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/app/timeoff-management/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
== 20171218-company-wide-message: migrated (0.026s)
== 20171219-allowance-adjustment-per-year: migrating =======
{ SequelizeDatabaseError: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint
at Query.formatError (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query. (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/app/timeoff-management/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
name: 'SequelizeDatabaseError',
message: 'ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint',
parent:
{ Error: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint
at Query.Sequence._packetToError (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
--------------------
at Protocol._enqueue (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Connection.query (/app/timeoff-management/node_modules/mysql/lib/Connection.js:200:25)
at /app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:40:21
at Promise._execute (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:79:10)
at Query.run (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:39:17)
at /app/timeoff-management/node_modules/sequelize/lib/sequelize.js:849:20
at /app/timeoff-management/node_modules/retry-as-promised/index.js:39:21
at Promise._execute (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/promise.js:79:10)
at retryAsPromised (/app/timeoff-management/node_modules/retry-as-promised/index.js:29:10)
at /app/timeoff-management/node_modules/sequelize/lib/sequelize.js:848:12
at tryCatcher (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:694:18)
at _drainQueueStep (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
code: 'ER_CANNOT_ADD_FOREIGN',
errno: 1215,
sqlMessage: 'Cannot add foreign key constraint',
sqlState: 'HY000',
index: 0,
sql: 'CREATE TABLE IF NOT EXISTS user_allowance_adjustment (id INTEGER NOT NULL auto_increment , year INTEGER NOT NULL DEFAULT '2019', adjustment INTEGER NOT NULL DEFAULT 0, carried_over_allowance INTEGER NOT NULL DEFAULT 0, created_at DATETIME NOT NULL, user_id INTEGER, PRIMARY KEY (id), FOREIGN KEY (user_id) REFERENCES Users (id) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;' },
original:
{ Error: ER_CANNOT_ADD_FOREIGN: Cannot add foreign key constraint
at Query.Sequence._packetToError (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
--------------------
at Protocol._enqueue (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Connection.query (/app/timeoff-management/node_modules/mysql/lib/Connection.js:200:25)
at /app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:40:21
at Promise._execute (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:79:10)
at Query.run (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:39:17)
at /app/timeoff-management/node_modules/sequelize/lib/sequelize.js:849:20
at /app/timeoff-management/node_modules/retry-as-promised/index.js:39:21
at Promise._execute (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/app/timeoff-management/node_modules/retry-as-promised/node_modules/bluebird/js/release/promise.js:79:10)
at retryAsPromised (/app/timeoff-management/node_modules/retry-as-promised/index.js:29:10)
at /app/timeoff-management/node_modules/sequelize/lib/sequelize.js:848:12
at tryCatcher (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:694:18)
at _drainQueueStep (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/app/timeoff-management/node_modules/sequelize/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
code: 'ER_CANNOT_ADD_FOREIGN',
errno: 1215,
sqlMessage: 'Cannot add foreign key constraint',
sqlState: 'HY000',
index: 0,
sql: 'CREATE TABLE IF NOT EXISTS user_allowance_adjustment (id INTEGER NOT NULL auto_increment , year INTEGER NOT NULL DEFAULT '2019', adjustment INTEGER NOT NULL DEFAULT 0, carried_over_allowance INTEGER NOT NULL DEFAULT 0, created_at DATETIME NOT NULL, user_id INTEGER, PRIMARY KEY (id), FOREIGN KEY (user_id) REFERENCES Users (id) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;' },
sql: 'CREATE TABLE IF NOT EXISTS user_allowance_adjustment (id INTEGER NOT NULL auto_increment , year INTEGER NOT NULL DEFAULT '2019', adjustment INTEGER NOT NULL DEFAULT 0, carried_over_allowance INTEGER NOT NULL DEFAULT 0, created_at DATETIME NOT NULL, user_id INTEGER, PRIMARY KEY (id), FOREIGN KEY (user_id) REFERENCES Users (id) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR<EMAIL_ADDRESS>db-update: node node_modules/.bin/sequelize db:migrate --config=config/db.json --models-path=lib/model/db/
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>db-update script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /app/.npm/_logs/2019-02-15T15_03_37_608Z-debug.log

<EMAIL_ADDRESS>start /app/timeoff-management
node bin/wwww

Unhandled rejection SequelizeDatabaseError: ER_BLOB_CANT_HAVE_DEFAULT: BLOB/TEXT column 'timezone' can't have a default value
at Query.formatError (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query. (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/app/timeoff-management/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
Executing (default): DELETE FROM Sessions WHERE expires < '2019-02-15 15:18:40'
Unhandled rejection SequelizeDatabaseError: ER_NO_SUCH_TABLE: Table 'timeoffmanagement.Sessions' doesn't exist
at Query.formatError (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
at Query. (/app/timeoff-management/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
at Query. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/app/timeoff-management/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/app/timeoff-management/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/app/timeoff-management/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:91:28)
at Socket. (/app/timeoff-management/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:601:20)
`

This what I did.

Run the App. (By doing this it will create all the tables in the database.)
Run the migration : node node_modules/.bin/sequelize db:migrate --config=config/db.json --models-path=lib/model/db/
It will flagged an error:
Loaded configuration file "config/db.json".
Using environment "development".
== 20190118-chnage-type-value-for-api-token: migrating =======
{ SequelizeDatabaseError: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PRAGMA foreign_keys=off' at line 1

to fix this, go to this migration and change PRAGMA foreign_keys=off; to SET FOREIGN_KEY_CHECKS=0. Change also PRAGMA foreign_keys=on; to SET FOREIGN_KEY_CHECKS=1
Then run the migration again and viola!!!

@randolf-alegre this might look a lame request but can you please elaborate on where to change pragma? is it migration specific or for all migrations?

Hi Yunas,
Sorry for the late reply. As far as I remember you need to change it to its
specific migration file where you encounter the error.
On Wed, Sep 7, 2022 at 3:37 AM yunas @.***> wrote:

@randolf-alegre https://github.com/randolf-alegre this might look a
lame request but can you please elaborate on where to change pragma? is it
migration specific or for all migrations?
—
Reply to this email directly, view it on GitHub
https://github.com/timeoff-management/timeoff-management-application/issues/329#issuecomment-1238573269,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAUNAFW5JQU4Z5ZJERLBJH3V46MOFANCNFSM4GTA7N4Q
.
You are receiving this because you were mentioned.Message ID:
<timeoff-management/timeoff-management-application/issues/329/1238573269@
github.com>


Rename dms* -> catalyst*

See this thread for context on the rename: https://discord.com/channels/423160867534929930/991388659699949669/1004599546933948486

There might be some similar changes needed in gh-workflow?

There might be some similar changes needed in gh-workflow?

Good call, for some reason my recursive grep didn't go into the .github


Tech debt: remove deprecated defaultProps

Saw this in browser console
CheckboxTree: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

A bit of grepping suggests some others may need doing too
packages/libs/wdk-client/src/Views/Answer/AnswerTable.jsx
packages/libs/wdk-client/src/Views/Records/RecordNavigation/RecordNavigationSection.jsx
packages/libs/wdk-client/src/Views/Records/RecordActionLink.jsx
packages/libs/wdk-client/src/Core/Root.tsx
packages/libs/wdk-client/src/Components/Display/TabbableContainer.tsx
packages/libs/wdk-client/src/Components/InputControls/NativeCheckboxList.tsx
packages/libs/wdk-client/src/Components/Overlays/Popup.tsx
packages/libs/wdk-client/src/Components/Shared/Spinnable.tsx
packages/libs/wdk-client/src/Components/SearchBox/RealTimeSearchBox.tsx
packages/libs/wdk-client/src/Components/AttributeFilter/FieldFilter.jsx
packages/libs/wdk-client/src/Components/AttributeFilter/MembershipField.jsx
packages/libs/wdk-client/src/Components/AttributeFilter/ServerSideAttributeFilter.jsx
packages/libs/wdk-client/src/Components/AttributeFilter/Histogram.jsx
packages/libs/coreui/src/components/inputs/checkboxes/CheckboxTree/CheckboxTree.tsx
packages/libs/coreui/src/components/inputs/SelectTree/SelectTree.tsx
packages/libs/coreui/src/assets/icons/CaretDown.tsx
packages/libs/coreui/src/assets/icons/CaretUp.tsx
packages/libs/coreui/src/assets/icons/DoubleArrow.tsx
packages/libs/coreui/src/assets/icons/Cancel.tsx
packages/libs/coreui/src/assets/icons/Arrow.tsx
packages/libs/web-common/src/components/records/Sequence.tsx
packages/libs/web-common/src/util/customElements.jsx

Also while we're at it!
Warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node


I encountered the same issue. Attempts at fixing it led to other errors which I described in https://github.com/flutter/flutter/issues/54571

posssibly related to https://github.com/flutter/flutter/issues/56479

Not related to #56479 which is a Dart compilation issue. This is an issue in the Xcode project's build phase scripts.

Can you guys describe what the repro steps are? Is this on a new flutter project? Created with 1.17 or before 1.17? Is this add-to-app? Can you share a simple repro project on GitHub?

@xste I stripped my app down to practically nothing but app_config.dart, main.dart, main_dev.dart and main_prod.dart.. Can confirm that the issue still exists with
flutter upgrade
flutter run -d all --flavor dev
`Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...
└─Compiling, linking and signing...                         5.0s
Xcode build done.                                           31.1s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
The path  does not exist
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description`
`Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.4 19E287, locale en-SG)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.44.2)
[✓] Connected device (1 available)
• No issues found!
`
I think it's linked to --flavor as you suspected here https://github.com/flutter/flutter/issues/56642

Ah I didn't see your full build invocation to notice your flavor part.
@jmagman can we dupe this with something? I believe you fixed it on master.

I was able to build and run after adding these manually into Embed Frameworks. Not sure if there are any side effects yet though.

I managed to resolve this by:

Adding
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
to Thin Binary
Adding App.framework to Embed Frameworks.

Im sorry, im new to all this and i dont know about iPhone or Xcode, where is it that you added the lines on #1? where can i find them?

You shouldn't embed App.framework, you'll hit https://github.com/flutter/flutter/issues/50568.

Hm, https://github.com/flutter/flutter/pull/51453 should have automatically upgraded you https://flutter.dev/docs/development/ios-project-migration, and I also would have expected those issues to look more like https://github.com/flutter/flutter/issues/52084.
Can you attach the Runner.build/Script-3B06AD1E1E4923F5004D2608.sh that the error is complaining about?

@jmagman
#52084 happens when I have added
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
to Thin Binary instead of using embed_and_thin (which is by default what is there after I run flutter upgrade from previous stable build)
@Martin-Alvarado-Void  The method I suggested allows me to build directly from Xcode onto an actual device, but fails in flutter run as it asks me to migrate the project to the new build method. You can find the Thin Binary under Build Phase in XCode.
I'm hitting a dead-end on this, so have reverted back to previous stable build for now.

@jmagman
#52084 happens when I have added
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
to Thin Binary instead of using embed_and_thin (which is by default what is there after I run flutter upgrade from previous stable build)
@Martin-Alvarado-Void The method I suggested allows me to build directly from Xcode onto an actual device, but fails in flutter run as it asks me to migrate the project to the new build method. You can find the Thin Binary under Build Phase in XCode.
I'm hitting a dead-end on this, so have reverted back to previous stable build for now.

Thank you for the reply, i saw this on another issue and tried it but it didnt work, so i:

started a new flutter project from Android Studio
copied all dart files from the old proyect
re-applied all dependencies. (And re-did the necesary set up for Firebase messaging again for both android and ios).

And after fixing a few other little issues (on setting up other dependencies i have) i got it up and running with the flutter 1.17.0 stable channel.
So it seems the easier way to solve this was to create it from scratch under the new channel since it took me less time to do than to continue trying and waiting on solutions.

I stripped my app down to practically nothing but app_config.dart, main.dart, main_dev.dart and main_prod.dart..
@joniaiuser Can you share this?  I'd like to look at your Xcode project.

https://github.com/joniaiuser/1.17.0reprobuild

@joniaiuser There's no Xcode project in there, can you include your ios directory?

https://github.com/flutter/flutter/blob/2a5690f0979ffe7e9c117422704b7d59ed93111b/packages/flutter_tools/bin/xcode_backend.sh#L267
I don't see FLUTTER_APPLICATION_PATH in your Xcode exports, and in fact I don't see any of the FLUTTER_ variables I would expect other than FLUTTER_ROOT (where did that come from)?
When you set up your flavors what configuration file (xcconfig file) are you basing them on?

Whatever build configuration you are using should have #include "Generated.xcconfig" to get the build settings that Flutter expects.  If you post your ios/Runner.xcodeproj/project.pbxproj  I can take a look.

Ok I tried again on 1.17.1 and it didn't work. I've added the ios/Runner.xcodeproj/project.pbxproj file to my github.
Thanks!

@joniaiuser Your base configurations needs to be Debug.xcconfig, not Pods-Runner.debug-dev.xcconfig (ditto Release for your relevant flavors).
baseConfigurationReference = F001327124D005441E5A8E33 /* Pods-Runner.debug-dev.xcconfig */;

I'm guessing this is fallout for flavors from https://github.com/flutter/flutter/pull/54691.  The Runner project should have never had a base configuration, only the Target.  Additional targets (watch app, notifications, frameworks, etc) incorrectly inherited Flutter-intended build settings from the project.  However, when you set up your flavor targets you didn't need to think about the base configuration since the project did this for you and you happened to inherit all the Flutter build settings.
I don't even see any official Flutter documentation for setting up flavors I can update and emphasize this point...

FLUTTER_ROOT = /Users/joniaiuser/Developer/flutter;

It looks like you added this manually (everyone reporting this must have) to get to the script file location assert.  Out of curiosity, why did you do that? Did you see it somewhere in documentation or Stack Overflow?

@jmagman iirc it was to fix xcode not finding flutter. I also set the configurations (shown above) to None before this so that cocopods stopped showing a warning message when trying to build, which was more of an error since it didnt build.

iirc it was to fix xcode not finding flutter.

How did that manifest?  How did you know it couldn't find Flutter?

It was on stack overflow as a way to fix flutter not found or similar error. I'm not on my mac now but i'll remove the FLUTTER_ROOT variable and let you know what happens.

@jifalops The fix is to make your flavor build configurations inherit from the Flutter .xcconfig files, not the Pod xcconfigs.  At that point you won't need a custom FLUTTER_ROOT build setting, though that's not the real problem here.
Unfortunately there isn't a lot of documentation about this (I see it mentioned in https://medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36 for example).

I'd be willing to bet most of the others here are xcode noobs like me.

@jifalops I know, it's pretty complicated and not well documented.  The default flutter create template handle all this for you, but once you're in Flavor Country you're signing up for a lot of Xcode nitty gritty.

fwiw, I'm not actually using build flavors in that way, I'm using the 'old' way of doing it: https://stackoverflow.com/questions/47438564/how-do-i-build-different-versions-of-my-flutter-app-for-qa-dev-prod/51005687#51005687

@jifalops Those aren't flavors, those are dart entry points, and I'm really curious what you could have hit if you weren't editing your Xcode build configurations.  Can see your ios/Runner.xcodeproj/project.pbxproj?  I've only investigated @joniaiuser's, which is definitely the build configuration inheritance issue.

Seems like I am facing a similar problem #57395. I have not used flavors at all. Also added project.pbxproj to github

@combi-35 I'm going to reopen that issue and we can discuss further there.

@jifalops If we can get your full flutter run output with the --verbose flag that would be helpful as well.

@jifalops Do you remember how long ago you created this project?  Can you attach your project .metadata file?

I created a project in v1.7.8-hotfixes and added a plugin, ran flutter build ios (after running pod install because of the old pod setup error), looks like:

Then I checked out v1.9.1-hotfixes, tried to flutter run.  Got this expected warning:
Warning: Podfile is out of date
  This can cause a mismatched version of Flutter to be embedded in your app, which may result in App Store submission rejection or crashes.
  If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/24641 for instructions.
To regenerate the Podfile, run:
  rm ios/Podfile

Followed the instructions and rm ios/Podfile, build again, build configurations look the same.  Checked out stable 1.17.1, build, etc, build configurations still set to Debug.xcconfig and Release.xcconfig.
Checked out master, hit the Project base configurations detected, removing. migration, now it looks like:

All build have succeeded.  I'm not sure how the base configurations would get set to those Pod xcconfigs unless you opened up the Xcode project and added build configurations, which
@jifalops and @combi-35 didn't...

@joniaiuser Your base configurations needs to be Debug.xcconfig, not Pods-Runner.debug-dev.xcconfig (ditto Release for your relevant flavors).
baseConfigurationReference = F001327124D005441E5A8E33 /* Pods-Runner.debug-dev.xcconfig */;

Should look something like (but with your flavors):

I'm guessing this is fallout for flavors from #54691. The Runner project should have never had a base configuration, only the Target. Additional targets (watch app, notifications, frameworks, etc) incorrectly inherited Flutter-intended build settings from the project. However, when you set up your flavor targets you didn't need to think about the base configuration since the project did this for you and you happened to inherit all the Flutter build settings.
I don't even see any official Flutter documentation for setting up flavors I can update and emphasize this point...

Is changing this configuration sufficient to fix the issue? I will give this a try soon.

I just remembered this all started when I updated the google_maps_flutter package and it required changing the min iOS version to 9.0.

.metadata
```
version:
  revision: e6b34c2b5c96bb95325269a29a84e83ed8909b5f
  channel: stable
project_type: app
```

`flutter run --verbose`.
It got cut off, and I still have FLUTTER_ROOT defined.
                         Use CoreServices instead. (in target 'FLAnimatedImage' from

project 'Pods')
warning: AssetsLibrary is deprecated. Consider migrating to Photos instead. (in target 'DKPhotoGallery'
from project 'Pods')
warning: MobileCoreServices has been renamed. Use CoreServices instead. (in target 'DKPhotoGallery' from
project 'Pods')
[+1668 ms] Could not build the application for the simulator.
[   +1 ms] Error launching application on iPhone SE (2nd generation).
[   +1 ms] "flutter run" took 34,420ms.
#0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:569:7)

#2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:722:18)
#3      _rootRunUnary (dart:async/zone.dart:1192:38)
#4      _CustomZone.runUnary (dart:async/zone.dart:1085:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:141:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
#7      Future._propagateToListeners (dart:async/future_impl.dart:711:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:526:5)
#9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:36:15)
#10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:298:13)
#11     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#12     _rootRunUnary (dart:async/zone.dart:1192:38)
#13     _CustomZone.runUnary (dart:async/zone.dart:1085:19)
#14     _FutureListener.handleValue (dart:async/future_impl.dart:141:18)
#15     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
#16     Future._propagateToListeners (dart:async/future_impl.dart:711:32)
#17     Future._completeWithValue (dart:async/future_impl.dart:526:5)
#18     Future._asyncComplete. (dart:async/future_impl.dart:556:7)
#19     _rootRun (dart:async/zone.dart:1184:13)
#20     _CustomZone.run (dart:async/zone.dart:1077:19)
#21     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
#22     _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1019:23)
#23     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#25     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#26     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
</details>

@joniaiuser That should be the fix, but I don't understand how you got into that state in the first place.  Did you edit it in Xcode manually by any chance?  Did you change your Flutter channel at any point?
@jifalops From those logs you are still missing the Flutter variables that are set in Generated.xcconfig (which are imported in Debug.xcconfig and Release.xcconfig and should be the base config).
Still trying to reproduce this https://github.com/flutter/flutter/issues/56507#issuecomment-631187387 but I'm missing something.

@LiveLikeCounter provided full logs at https://gist.github.com/LiveLikeCounter/562ad24437d6cce1ef19a79f1a081426
https://github.com/flutter/flutter/issues/57395#issuecomment-631504876

@joniaiuser That should be the fix, but I don't understand how you got into that state in the first place. Did you edit it in Xcode manually by any chance? Did you change your Flutter channel at any point?

I just remembered this all started when I updated the google_maps_flutter package and it required changing the min iOS version to 9.0.

@jifalops How exactly did you fix that? From those logs you are still missing the Flutter variables that are set in Generated.xcconfig (which are imported in Debug.xcconfig and Release.xcconfig and should be the base config).
Still trying to reproduce this #56507 (comment) but I'm missing something.

@jmagman I went to search through my commits in my repo. Turns out the change happened sometime last year about 1000 commits ago..
I can't pinpoint exactly what triggered it but the culprits are one of the following:

Uncommenting this

Uncomment this line to define a global platform for your project
platform :ios, '9.0'	platform :ios, '9.0'

Trying the legacy build system in Xcode
Adding Firebase Analytics package

More likely 1 or 2..

@joniaiuser Do you see any commits that changed your ios/Runner.xcodeproj/project.pbxproj file to baseConfigurationReference = 3A5B181917B5F68797695603 /* Pods-Runner.debug.xcconfig */;?  It was created as baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;

Yes, it's in that same commit.

@joniaiuser Was that your first Flutter plugin?  Can I get that diff?

Also, any chance you saw a warning like this and followed its advice?
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

Flutter suppresses that warning since the set custom config is already correct, but if you ran pod install directly you would see it.

flutter_diff_log_edited.pdf
I redacted some info.

My best guess is that neither the flutter tool nor CocoaPods are responsible for the swap from Debug.xcconfig and Release.xcconfig to the Pod equivalents and this was done manually by developers, possibly because they saw some instructions to do so from CocoaPods or some other advice from Stack Overflow.  This could also happen by adding flavor configurations and choosing the wrong base configuration.
@joniaiuser @jifalops @LiveLikeCounter and @combi-35 all provided logs showing they manually set a FLUTTER_ROOT build setting, presumably to work around the build script not finding the xcode_build.sh.  The correct fix was to keep the default Debug.xcconfig and Release.xcconfig base configurations, which import Generated.xcconfig.  Anyone with a base configuration that isn't importing Generated.xcconfig may be hitting all kinds of issues (build version not set, flavors don't work, advanced dart features don't apply...).
I just created a random project, and my Generated.xcconfig looks like:
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/m/Projects/flutter
FLUTTER_APPLICATION_PATH=/Users/m/Projects/test_build_configs
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
OTHER_LDFLAGS=$(inherited) -framework Flutter
FLUTTER_FRAMEWORK_DIR=/Users/m/Projects/flutter/bin/cache/artifacts/engine/ios-release
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=false
TREE_SHAKE_ICONS=true

https://github.com/flutter/flutter/pull/51453 started using FLUTTER_APPLICATION_PATH, which also isn't present for these misconfigured projects, and is why users are starting to see this in 1.17.
I put https://github.com/flutter/flutter/pull/57701 out for review.  This is the bare minimum to get apps with misconfigured Xcode projects back to building
The real solution is to do https://github.com/flutter/flutter/issues/12749 and tell users that are missing FLUTTER_ROOT to fix their base configuration to point to Debug.xcconfig or Release.xcconfig.  However that requires a tricky Xcode project migration since it needs to happen before xcode_backend.sh is called and not found.
TL;DR
There's a workaround out for review that may be hotfixed to 1.17, but if you are hitting this, you may continue to hit iOS build issues.

open ios/Runner.xcworkspace in Xcode.
Open your Project Runner build settings > Info tab.
Expand Debug, Profile, Release, and any other configurations and make sure the "Based on Configuration File" is set to either Debug.xcconfig or Release.xcconfig (Profile uses Release.xcconfig, confusingly).

Bonus: delete any custom FLUTTER_ROOT build settings you may have added to work around this issue.

Resolved for me. Thanks! @jmagman

@jmagman Thank you so much for your comment. I applied the settings you're showing. I had no FLUTTER_ROOT or FLUTTER_anything at that moment.
Still the same when I start the App on an emulator:
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Xcode build done.                                           17.3s
Failed to find assets path for "Frameworks/App.framework/flutter_assets"
[VERBOSE-2:engine.cc(129)] Engine run configuration was invalid.
[VERBOSE-2:shell.cc(485)] Could not launch engine with configuration.

I've saved my project.pbxproj in a new Gist: https://gist.github.com/LiveLikeCounter/39322c64f5a89bf043d09ca6d67fd2bf
My fluter doctor -v is still the same: everything green on v1.17.1 (Mac)
Any help is much appreciated!

Resolved for me. Thanks! @jmagman

@joniaiuser would you mind sharing your project.pbxproj or other ios-dependencies? Then I can compare the differences. Hope to find something.

Oke, I finally get it managed to work-a-round this issues by:

Backup my ios folder
Run flutter create . in my root folder
Then the ios works on the simulator again 😃
Adding step by step back the Firebase-related configurations like the GoogleService-Info.plist, changing the AppDelegate.swift, etc.

Hope this will help someone who is encounter the same...

My best guess is that neither the flutter tool nor CocoaPods are responsible for the swap from Debug.xcconfig and Release.xcconfig to the Pod equivalents and this was done manually by developers, possibly because they saw some instructions to do so from CocoaPods or some other advice from Stack Overflow.

I'd still like to get some insight into how this happened to so many people since I wasn't able to reproduce it.  Was it changed manually due to some suggestion on SO or the CocoaPods message?  If it wasn't changed manually by the developer, did CocoaPods change it, and if so what version?  What version of Flutter was the app created in (SHA in .metadata file)?

The workaround is available on the stable branch in 1.17.2.  Closing.

I'm experiencing this issue on the current stable branch, and the provided solution above doesn't seem to be working for me...

@DanielSmith1239 can you provide your logs and your flutter doctor -v ?

@DanielSmith1239

your Xcode project is misconfigured and you should fix it. See details in #56507 (comment).

Faced the same problem and it seems like the problem was with the generated project file after the migration to the latest version of flutter.
What fixed it for me was changing the following in the Build Phases in XCode or directly in the project file project.pbxproj
$FLUTTER_ROOT to ${FLUTTER_ROOT}


Repo licencing

Hi, I would like to integrate this codebase into an MIT licenced project. Currently I can't do this due to this repo falling under "All Rights Reserved" due to the lack of a licence file. Could you please add a licence?

https://github.com/cyxx/extract_android_ota_payload/pull/22


Shaka player offline api, when abort clears IndexDB

Have you read the Tutorials?
YES
Have you read the FAQ and checked for duplicate open issues?
YES
If the question is related to FairPlay, have you read the tutorial?

What version of Shaka Player are you using?
V4.9.3
What browser and OS are you using?
Mac OS 14.5 (23F79)
Please ask your question
I need some query in the shaka player offline api, i saw a ticket where resume and pause apparently is not supported natively, if so is there any alternative lib that does support? The other question is when I use this
"(method) globalThis.shaka.extern.IAbortableOperation.abort(): Promise (+1 overload)"
the segement in IndexedDB->shaka_offline_db->segment-v5 gets cleared. Don't know why it deleting all the downloaded segment. The only way its doesn't clear is if I have downloaded the entire file. If there is a sample for custom resume and pause download for api that would be great.

The functionality is not supported because we do not yet support play/pause for offline, see: https://github.com/shaka-project/shaka-player/issues/1301, I recommend that we follow up on this in that issue. thank you!


2 readers secure cycling 1 cycles the other

2 OSDP readers addresses 0x00 and 0x01.  both in secure channel.
scenario:
both readers powered on, secure channel active
power off reader at address 0x01  do not disturb the other reader.
console shows reader a=0x01 offline
osdp,net starts sending CHLNG messages seeking the missing reader on address 0x01
power on reader
osdp.net reports reader 0x00 offline and reader 0x01 online
subsequently it shows reader 0x00 online again so both are online
what is happening:
when power is reapplied to the (second) reader it sends a chlng to the second reader and then for no reason sends a chlng to the first reader too.  this causes the first reader to cycle the secure channel session thus showing the offline/online bounce.
this is with <IP_ADDRESS>

Please test again with new version 2.0.12. I'm unable to reproduce the issue with the latest update.

I can reopen this issue if we are able to reproduce.


module 'dowhy.gcm' has no attribute 'fit_and_compute'

in gcm_rca_microservice_architecture.ipynb
code:
median_attribs, uncertainty_attribs = gcm.confidence_intervals(
    gcm.fit_and_compute(gcm.attribute_anomalies,
                    causal_model,
                    normal_data,
                    target_node='Website',
                    anomaly_samples=outlier_data),
    num_bootstrap_resamples=10)

it doesn't work and report module 'dowhy.gcm' has no attribute 'fit_and_compute'

@Mrzhangxiaohua Which version of DoWhy are you using? Also, could you please provide a stacktrace.

@petergtz the stacktrace is below:
AttributeError                            Traceback (most recent call last)
Cell In[39], line 4
1 gcm.config.disable_progress_bars() # to disable print statements when computing Shapley values
3 median_attribs, uncertainty_attribs = gcm.confidence_intervals(
----> 4     gcm.fit_and_compute(gcm.attribute_anomalies,
5                         causal_model,
6                         normal_data,
7                         target_node='Website',
8                         anomaly_samples=outlier_data),
9     num_bootstrap_resamples=10)
AttributeError: module 'dowhy.gcm' has no attribute 'fit_and_compute'

@Mrzhangxiaohua Which version of DoWhy are you using? Also, could you please provide a stacktrace.
the dowhy version is 0.8

the stacktrace is below:
AttributeError Traceback (most recent call last)
Cell In[39], line 4
1 gcm.config.disable_progress_bars() # to disable print statements when computing Shapley values
3 median_attribs, uncertainty_attribs = gcm.confidence_intervals(
----> 4 gcm.fit_and_compute(gcm.attribute_anomalies,
5 causal_model,
6 normal_data,
7 target_node='Website',
8 anomaly_samples=outlier_data),
9 num_bootstrap_resamples=10)
AttributeError: module 'dowhy.gcm' has no attribute 'fit_and_compute'

@Mrzhangxiaohua Please update to version 0.9.1. This function was renamed and has a different name in version 0.8.

yeah，when i update the correct version，the problem has been solved 👍


Support multiple projections

Add functionality to init the map with a different projection (like EPSG:4326). Bonus points if we implement a projection switcher that allows this on the fly.

Will be very much needed for our planned polar dashboard v5 which has datasets which are both interesting in some Polar projection and EPSG:4326 so on-demand-switcher (replacing existing used OL view with a one with a different projection).

I will look into it as soon as possible

Implemented in https://github.com/EOX-A/EOxElements/pull/730


Add the ability to specify a different console for a new process on an existing container

There is a limitation regarding the ability to provide a different console than container's one in case we are trying to execute a new process on this existing container. Indeed, because the console is tied to the ContainerConfig structure, we have no way to specify a different console for another process.
This PR moves Interactive and Console fields from the structure ContainerConfig to Cmd, solving our current limitation.
This PR fixes issue #204.

@jodh-intel I merged #206 to the wrong branch...
Could give LGTM for this one please ?

lgtm

thanks @jodh-intel

Coverage decreased (-0.2%) to 67.404% when pulling 1f8dabaf4ae7456caa84ead0ec1210076ca6c4e8 on sboeuf/fix_issue_204 into 88e339f10e23b5c0d0565c40b7a9e39fcecfd591 on master.


Error loading shared library libresolv.so.2 on Alpine in Go 1.20

This is a reopening of #59304 -- which was closed with a not very helpful "working as intended" message.
Searching this GitHub repo for musl libc shows lots of existing relevant issues/code adaptations. People, like me, could maybe be lead to believe that Musl Libc was supported (and Alpine is a very popular Docker runtime). I'm not saying that this is a bug, but it's at least a documentation issue.
I understand that with the big number of issues in your back log, you need to somehow be very effective about this, but these short and cranky brush offs with "working as intended" is, I suspect, not having the effect you want in the long run.

As of 1.20, you're responsible for linking against C libraries properly if you build with CGo enabled.
Previously, go was distributed with prebuilt archives linked against ancient c library versions. As documented, we no longer do so.
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
For questions please refer to https://github.com/golang/go/wiki/Questions

@bep Can you show us how to recreate the problem?  Right now I don't understand it, and I don't see any clear reproduction instructions in the earlier issues.  Thanks.

As of 1.20, you're responsible for linking against C libraries properly if you build with CGo enabled.

@seankhliao That I understand, but this is a C library that the Go standard library (this repo) is linking, I assume to do DNS lookups.
@ianlancetaylor I will put on my list and try to reproduce this in a simpler setup, but as this involves thinkering with Docker (not my favourite), it may take a few days. But please don't close this issue prematurely.

You can see that minikube v1.30.0 suffers from this problem.

@ianlancetaylor I am not building minikube at all. I am using the binary they distribute. See https://github.com/kubernetes/minikube/issues/16228

@Nuru Is it possible that the binary that they distribute was built with glibc, but that you are running it in a container that uses Alpine?

The main difference is that due to the change above (in 1.20), there is now a new libresolv.so.2 depency:
$ go version ./minikube-1.29.0
./minikube-1.29.0: go1.19.5
$ ldd minikube-1.29.0
	linux-vdso.so.1 (0x00007ffcdc5f7000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f312da7d000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f312da5a000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f312dc86000)
$ go version ./minikube-1.30.0
./minikube-1.30.0: go1.20.2
$ ldd minikube-1.30.0
	linux-vdso.so.1 (0x00007ffc583db000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f40eb1b2000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f40eb18f000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f40eb173000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f40eb3bb000)

The glibc compatibility in Alpine (gcompat) needs to be updated to handle this too - or run a musl binary....

@Nuru Is it possible that the binary that they distribute was built with glibc, but that you are running it in a container that uses Alpine?

That's exactly it yes. We have a "smoke test" now failing with this issue where we build a simple hello world HTTP API using the default golang docker image and copy the resulting binary to the default alpine image. (We introduced that smoke tests because a lot of our package users compile their Go programs this way and wanted to catch any issues asap.)
Something like:
FROM golang:1.20 AS build
WORKDIR /app
COPY . .
RUN go build -o program .

FROM alpine
COPY --from=build program .
RUN ./program

If you want a "real" alpine binary (instead of troubleshooting the glibc compat), you can build with CC=musl-gcc.
For minikube we didn't want to ship double (or static) binaries, but maybe someone else want dynamic musl binaries ?
$ musl-ldd out/minikube
	/lib/ld-musl-x86_64.so.1 (0x7f6b07e40000)
	libc.so => /lib/ld-musl-x86_64.so.1 (0x7f6b07e40000)

There is a libgcompat.so library, that exports the needed symbols from the real libc. So it would be possible to fix this in the Alpine distribution, so that the default glibc compatibility layer handles this new "libresolv" like it handles "libpthread"

If you want a "real" alpine binary (instead of troubleshooting the glibc compatibility), you can build with CC=musl-gcc*.

Thanks, that's exactly what we just did and it works. We will probably provide this answer to our users raising this specific issue (cross-compiling is the still in the usual "bring-your-own-toolchain" case).

Do you have a link to the Alpine issue, about this ? I guess it would be in their interest, to be able to run go1.20 binaries

I opened this issue with Alpine.

apk add gcompat .
gcompat  include libresolv.so.2
https://pkgs.alpinelinux.org/contents?file=libresolv.so.2&path=&name=&branch=edge

apk add gcompat gcompat include libresolv.so.2 https://pkgs.alpinelinux.org/contents?file=libresolv.so.2&path=&name=&branch=edge

I also meet this problem. After following your repair steps, it was not successful and another error message appeared:
Segmentation fault (core dumped)


Add create cache at production build

Maybe we can make use of universal prerenderer?

Because now we can use FileSystemCacheHandler we can re-use prerendered pages as cached pages.
Closing as Done.


Add support for Bytes in postgres adapter

This PR needs a closer review due to the following change:
Currently, in a request to create an object, the postgres adapter throws a runtime error if the request contains a field that doesn't exist in the corresponding schema. This PR (apart from adding support for Bytes) updates the schema for such requests.
Edit: It ignores parse specific fields (those that begin with an underscore) for this action.
Edit 2: The same part of code now sets the field type to String (is this acceptable?) if the value of the new field is null. This particular change allows enabling another previously excluded test for postgres.
This change was required to get one test (enabled as part of this PR) to run successfully against Postgres
Is this behavior acceptable?

Updated the original comments above with new info

The same part of code now sets the field type to String (is this acceptable?)

Not sure actually if we should put it as String, but why not actually. What does it do in the mongodb adapter?

Actually, this test on mongodb doesn't create an entry in the _SCHEMA

        let rp = require('request-promise');
        rp.get(Parse.serverURL+'/schemas/TestObject',{
          headers: {
            'X-Parse-Application-Id': Parse.applicationId,
            'X-Parse-Master-Key': Parse.masterKey
          }
        }).then((res) => {
          console.log(res);
          done();
        }, (err) => {
          console.error(err);
          done();
        })

{"className":"TestObject","fields":{"objectId":{"type":"String"},"createdAt":{"type":"Date"},"updatedAt":{"type":"Date"},"ACL":{"type":"ACL"}},"classLevelPermissions":{"find":{"*":true},"get":{"*":true},"create":{"*":true},"update":{"*":true},"delete":{"*":true},"addField":{"*":true}}}

I'm not sure but it seems to be that mongodb creates/modifies the type of a field based on the type of the value supplied.

I'm not sure but it seems to be that mongodb creates/modifies the type of a field based on the type of the value supplied.

Actually, this test on mongodb doesn't create an entry in the _SCHEMA

Something like this won't be possible with postgres as it needs a field defined before a value can be inserted. Mongodb can store a new field even if it hasn't been defined.
So the available options seems to include either not supporting this behavior in Postgres or modifying the schema in case a new field is supplied

Yeah that' sproblematic, I would keep that support out, and prevent this behaviour to happen altogether in postgres. null fields when schema is missing should not be supported with PG don't you think?

I remember seeing an addFields permission in the parse dashboard but couldn't understand how/where that is used in parse-server.
I think that the ideal setup would be to create a new field (either in the manner this PR does or some other way) if addFields allows it and to not add a new field if addField doesn't allow it.
As for new fields with null values, I agree that it shouldn't be allowed with Postgres as it doesn't make sense.
If, for now, we decide to not add one or both of these features, I think the tests that this PR touches should be modified to reflect this. So the tests can be declared as applying to mongodb only and new tests can be created specifically for Postgres to test against the currently intended behavior.

if addFields allows it and to not add a new field if addField doesn't allow it.

Yeah we actually need to enforce that but that should be done at a higher level. i.e.: the field should have been created before the object is being actually saved.

Yeah we actually need to enforce that but that should be done at a higher level. i.e.: the field should have been created before the object is being actually saved.

I imagined so but I don't really want to mess around with code that could affect the MongoDB side of things.

this is why we have it_excludes_dbs(), and on_db for the different behaviours

I should have worded that better. What I meant was that, currently, while the tests using it_exclude_dbs and the other functions do exclude a particular database, it isn't clear which test is temporarily targeting a particular DB (while postgres support is improved) and which is by design (permanent)
So based on this discussion, for example, the test testing new fields with null values should be marked as something that has been considered (and determined as not applicable) for Postgres and will ALWAYS only apply to MongoDB.
So how should I proceed with this PR?
Based on this discussion, it seems that:

The handling of new field addition should be managed earlier in the request processing and should not be part of this PR
The test for new fields for null values should somehow (even if via comments) be marked as permanently not applicable Postgres
A new test should be written to test the ability of the Postgres adapter to handle bytes (a test that doesn't depend on the database adapter to create a field if it doesn't exist)

If there's any other way you'd prefer to proceed with this PR, let me know.

If it's not clear how to proceed with this, should this PR be closed?

Initially the PR was for bytes support, I'm not sure why the field is not added if needed prior to the Postgres write. All the other parts, as you mention, will probably be marked as incompatible with Postgres.

I was actually trying to get existing tests to run against Postgres and the support for Bytes came out of that. (initially, I didn't even know parse server had support for bytes)
The existing test for bytes support didn't work with Postgres because the adapter couldn't find the new field in the schema (even though it existed in the object that was to be updated).
The Postgres adapter was looping over keys of the object and was then building the query based on the schema. It was throwing an exception because it couldn't find the new field in the schema, causing the test to fail.
This was why I added the ability to add new fields to the schema.
My proposal is to

let these two tests remain specific to MongoDB and add a new test for bytes support in Postgres.
not make the decision to add a new field in the adapter. This decision belongs someplace earlier

My proposal is to

let these two tests remain specific to MongoDB and add a new test for bytes support in Postgres.
not make the decision to add a new field in the adapter. This decision belongs someplace earlier
👍

I'm thoroughly confused now. It doesn't look like Bytes is a valid type.
Not sure what's going on in this test (it may be due to my lack of familiarity with MongoDB). But after seeing the allowed types in SchemaController, I think it might be best to scrap this PR.

lol :)

Your call, I mean there is a test for the bytes format but it's not supported in the clients, I'M not sure why.

I think it's best I don't mess around with things that I don't understand completely :smile:

hi, I have some question to ask to you

I see your realized postgresAdapter in the last version, and we test it is just ok , I wonder to know why you choose postgres ,rather than mysql and so on.

if postgres and mongodb can only choose one , how rule can we according to ?

weather one app can choose both of them?

when we use postgres , What we have to pay attention to?


Upgrade to specs 15.0

I wrote a PR for this, but I just realized that I specs-hierarchy isn't updated either.
Once I get a PR in for that, I can merge :D

The PR is #10 for reference.

#23

fixed