pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

Could not read input: The variable PGLOADER.USER-SYMBOLS::... is unbound.

Open BenCretois opened this issue 4 years ago • 1 comments

Thanks for contributing to pgloader by reporting an issue! Reporting an issue is the only way we can solve problems, fix bugs, and improve both the software and its user experience in general.

The best bug reports follow those 3 simple steps:

  1. show what you did,
  2. show the result you got,
  3. explain how the result is not what you expected.

In the case of pgloader, here's the information I will need to read in your bug report. Having all of this is a big help, and often means the bug you reported can be fixed very efficiently as soon as I get to it.

Please provide the following information:

  • [X] pgloader --version

    pgloader version "3.6.1"
    compiled with SBCL 1.4.15.debian
    
  • [ ] did you test a fresh compile from the source tree?

  • [X] did you search for other similar issues?

  • [X] how can I reproduce the bug?

+ cat PCR_prep.csv
pcr_id,pcr_date,pcr_personel,pcr_annealing_temp,pcr_annealing_temp_unit,pcr_conditions,pcr_volume,pcr_volume_unit,pcr_instrument_type,pcr_analysis_software,sample_size_unit,organism_quantity_type
dd_0387,2020-09-22,Hege Brandsegg,60,Degrees Celcius,initial_denaturation:95_10 | denaturation: 95:0.3 annealing:60_1 x40 | final elongation:98_10,22,µl,BioRad QX200 AutoDG,BioRad QuantaSoft v1.7.4,ddPCR droplets,ddPCR droplets
+ pgloader --type csv --with 'fields terminated by '\'','\''' --with 'csv header' --on-error-stop PCR_prep.csv 'postgresql://postgres@localhost/postgres?tablename=pcr_prep'
  • [X] pgloader output you obtain
2021-08-19T12:02:27.025000Z LOG pgloader version "3.6.1"
2021-08-19T12:02:27.226000Z WARNING Target table "\"public\".\"pcr_prep\"" has 2 indexes defined against it.
2021-08-19T12:02:27.226000Z WARNING That could impact loading performance badly.
2021-08-19T12:02:27.226000Z WARNING Consider the option 'drop indexes'.
; in: LAMBDA (PGLOADER.SOURCES::ROW)
;     (VECTOR PGLOADER.USER-SYMBOLS::PCR_ID PGLOADER.USER-SYMBOLS::PCR_GUID
;             PGLOADER.USER-SYMBOLS::PCR_DATE PGLOADER.USER-SYMBOLS::PCR_PERSONEL
;             PGLOADER.USER-SYMBOLS::PCR_ANNEALING_TEMP
;             PGLOADER.USER-SYMBOLS::PCR_ANNEALING_TEMP_UNIT
;             PGLOADER.USER-SYMBOLS::PCR_CONDITIONS
;             PGLOADER.USER-SYMBOLS::PCR_VOLUME
;             PGLOADER.USER-SYMBOLS::PCR_VOLUME_UNIT
;             PGLOADER.USER-SYMBOLS::PCR_INSTRUMENT_TYPE
;             PGLOADER.USER-SYMBOLS::PCR_ANALYSIS_SOFTWARE ...)
; --> MAKE-ARRAY MAKE-ARRAY LOCALLY 
; ==>
;   (VECTOR PGLOADER.USER-SYMBOLS::PCR_ID PGLOADER.USER-SYMBOLS::PCR_GUID
;           PGLOADER.USER-SYMBOLS::PCR_DATE PGLOADER.USER-SYMBOLS::PCR_PERSONEL
;           PGLOADER.USER-SYMBOLS::PCR_ANNEALING_TEMP
;           PGLOADER.USER-SYMBOLS::PCR_ANNEALING_TEMP_UNIT
;           PGLOADER.USER-SYMBOLS::PCR_CONDITIONS
;           PGLOADER.USER-SYMBOLS::PCR_VOLUME
;           PGLOADER.USER-SYMBOLS::PCR_VOLUME_UNIT
;           PGLOADER.USER-SYMBOLS::PCR_INSTRUMENT_TYPE
;           PGLOADER.USER-SYMBOLS::PCR_ANALYSIS_SOFTWARE ...)
; 
; caught WARNING:
;   undefined variable: PGLOADER.USER-SYMBOLS::PCR_GUID
; 
; caught WARNING:
;   undefined variable: PGLOADER.USER-SYMBOLS::QUANTITY_UNIT
; 
; compilation unit finished
;   Undefined variables:
;     PGLOADER.USER-SYMBOLS::PCR_GUID PGLOADER.USER-SYMBOLS::QUANTITY_UNIT
;   caught 2 WARNING conditions
2021-08-19T12:02:27.309000Z ERROR Could not read input: The variable PGLOADER.USER-SYMBOLS::PCR_GUID is unbound.
2021-08-19T12:02:27.309000Z LOG report summary reset
             table name     errors       rows      bytes      total time
-----------------------  ---------  ---------  ---------  --------------
                  fetch          0          0                     0.012s
-----------------------  ---------  ---------  ---------  --------------
    "public"."pcr_prep"          1          0                     0.028s
-----------------------  ---------  ---------  ---------  --------------
        Files Processed          0          1                     0.050s
COPY Threads Completion          0          2                     0.027s
-----------------------  ---------  ---------  ---------  --------------
      Total import time          1          0                     0.077s
  • [X] data that is being loaded, if relevant
  • [X] How the data is different from what you expected, if relevant

No data is being loaded.

BenCretois avatar Aug 19 '21 12:08 BenCretois

This error, "ERROR Could not read input: The variable PGLOADER.USER-SYMBOLS::[myfieldname] is unbound" occurred for me when [myfieldname] was in the destination table, but not in my input file. To eliminate the error, I dropped the column from the destination table.

tallpeak avatar Jan 15 '22 19:01 tallpeak